/**
 * Workflow execution engine.
 *
 * Loads a workflow's structured steps, resolves their dependency order,
 * executes each step, passes outputs between steps via named template
 * variables, and records the entire run as WorkflowRun + StepResult nodes.
 *
 * Two step types are supported:
 *   type: "tool"  — spawns a plugin MCP server child process
 *   type: "llm"   — spawns Claude Code subprocess (handles its own OAuth)
 *
 *   LOAD WORKFLOW + STEPS
 *     │
 *     v
 *   PRE-FLIGHT LLM GATE (Task 74)
 *     │   Only runs if the workflow has ≥1 llm step.
 *     ├─ probeLlmHealth("pong") ok → llmAvailable = true
 *     └─ probe fails → llmAvailable = false, probeError captured
 *     │
 *     v
 *   CREATE WorkflowRun (status: running)
 *     │
 *     v
 *   RESOLVE ORDER (topological sort)
 *     │
 *     v
 *   FOR EACH STEP:
 *     ├─ type: "tool"
 *     │    resolve {{templates}} in params → spawn MCP server → call tool
 *     ├─ type: "llm" + llm available
 *     │    resolve {{templates}} in prompt → spawn Claude Code → capture text
 *     │    └─ spawn fails + fallbackMode "raw" → render fallback (degraded)
 *     ├─ type: "llm" + llm NOT available
 *     │    ├─ fallbackMode "raw"  → render fallback (degraded), continue
 *     │    └─ fallbackMode "fail" → onFailure policy, retry short-circuited
 *     ├─ parse output (JSON or _raw fallback, strips markdown fences)
 *     ├─ store output under step's outputKey
 *     ├─ create StepResult node (status: completed | degraded | skipped | failed)
 *     └─ on failure: abort | skip | retry (per step config)
 *     │
 *     v
 *   UPDATE WorkflowRun status:
 *     any failed → "failed"
 *     any degraded or skipped → "partial"
 *     else → "completed"
 */
export interface WorkflowExecuteParams {
    workflowId: string;
    accountId: string;
    context?: Record<string, unknown>;
    trigger?: "conversational" | "schedule" | "manual";
}
export interface WorkflowExecuteResult {
    runId: string;
    status: "completed" | "partial" | "failed";
    stepsCompleted: number;
    stepsDegraded: number;
    stepsSkipped: number;
    stepsFailed: number;
    stepsTotal: number;
    error?: string;
}
export declare function workflowExecute(params: WorkflowExecuteParams): Promise<WorkflowExecuteResult>;
//# sourceMappingURL=workflow-execute.d.ts.map