Generate an automation draft definition with Workers AI
Requires ADMIN. Returns a draft definition only (never writes journeys/versions, never auto-publishes). 503 when Workers AI binding is absent.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Project (tenant) identifier. Row-level tenant isolation is enforced on every query.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Journey/automation graph definition. Nodes are typed (trigger/action/branch/wait/waitForEvent/timeWindow).
object
object
object
Optional audit linkage for extend mode.
Responses
Section titled “Responses”Generated draft definition with annotated new node IDs.
object
Journey/automation graph definition. Nodes are typed (trigger/action/branch/wait/waitForEvent/timeWindow).
object
object
Not authenticated (401 via requireAuthenticated) or insufficient project role (403).
object
Human-readable error message.
Examplegenerated
{ "error": "example", "message": "example"}Param validation failed, or generation did not pass validation (error in [invalid_request, generation_invalid]); may include draftId.
object
object
Examplegenerated
{ "error": "example", "message": "example", "errors": [ "example" ], "issues": [ {} ], "draftId": "example"}Workers AI unavailable (error=ai_unavailable).
object
Human-readable error message.
Examplegenerated
{ "error": "example", "message": "example"}