Workflow execution
Workflow execution
Section titled “Workflow execution”Saved graphs are executed by the existing Rust run executor. Next.js never schedules work.
POST /api/v1/workflowsstores a draft (invalid graphs allowed whendraft: true).POST /api/v1/workflows/{id}/publishvalidates and writes an immutableworkflow_versionsrow.POST /api/v1/workflows/{id}/runcreates a normal run whosemetadata.workflow.definitionis the pinned snapshot.RunExecutor::executedetects the pinned definition and callsexecute_workflowincrates/goshikq-runtime/src/workflow_exec.rs.- Node state is persisted in
workflow_node_executionsand listed atGET /api/v1/runs/{id}/workflow-nodes. - The run appears in the standard execution explorer.
Node mapping
Section titled “Node mapping”| Node | Runtime behavior |
|---|---|
| START | Copies run input into context |
| AGENT | Native marker by default (completed: true). Set config.spawn: true to create a child run via create_child_task. Spawned children need a worker; without one the parent fails WORKER_UNAVAILABLE (not success). |
| TOOL | Native echo / declared result for demos. handler: registered (or any non-echo/fail handler with config.tool) dispatches through the action journal and worker protocol. Missing workers fail WORKER_UNAVAILABLE without dispatch. |
| CONDITION | Small expression language (true/false, JSON pointers, == / !=) |
| PARALLEL | Fork marker; successors run when ready |
| JOIN | all or any of incoming predecessors |
| APPROVAL | Existing approval row + waiter (WAITING_FOR_APPROVAL) |
| WAIT | Durable WAITING_FOR_EXTERNAL_STATE until duration_ms |
| VERIFY | JSON predicate on workflow context; does not treat child SUCCESS as VERIFIED |
| END | Completes the coordinator run |
Recovery and idempotency
Section titled “Recovery and idempotency”Completed nodes are not re-executed. A node that crashed while running a NON_IDEMPOTENT_WRITE / IRREVERSIBLE tool becomes RECOVERY_REQUIRED. Agent children reuse idempotency_key=wf:{run}:{node}. Editing a workflow after publish does not mutate in-flight runs; they keep the pinned snapshot.
Events
Section titled “Events”Canonical ExecutionEvent types: run.started, agent.delegated, approval.*, verification.*, tool.started / tool.completed with payload.workflow_node.