MINARA

Generate a workflow from a prompt

POST /v1/workflows/generate — LLM authoring: turns a plain-language description into a validated WorkflowDefinition. Runs the workflow-authoring subag

POST /v1/workflows/generate

LLM authoring: turns a plain-language description into a validated WorkflowDefinition. Runs the workflow-authoring subagent with up to 3 attempts; each retry receives a structured error locator describing why the previous attempt failed validation. Streams events in attempt-bounded groups; the canvas updates on the terminal workflow.commit only. On validation failure after MAX_ATTEMPTS, emits cluster.rollback{reason:'validation_failed'} and skips the row creation.

MethodPOST
Path/v1/workflows/generate
AuthAuthorization: Bearer <token> required when GATEWAY_AUTH_TOKEN is set
Categoryworkflows

Request body

{ "prompt": "Alert me when BTC drops 5% in 24h via Telegram." }

Response body

text/event-stream. Events fire in attempt-bounded groups:
  cluster.attempt_start { attempt, total_budget }
  cluster.node_code_delta { step_name, delta }
  cluster.node_add { step_name, kind, definition }
  workflow.patch  (preview only — does NOT mutate the canvas)
  cluster.attempt_discard { attempt, errors } OR cluster.validate { ok }
  workflow.commit { definition, attempt }  (only on the validated attempt)
  cluster.rollback { reason: 'messaging_gate' | 'persist_failed' | 'validation_failed' | 'stream_error' }
  assistant.message { text }  (delta-streamed)
  workflow.created { workflow, validation, ignored_fields, source }
  error { message, code }

On this page