Workflow Authoring Reference
Use this reference when you want Dawn, an agent, or an API client to create and update workflows predictably. It documents the workflow definition shape, field semantics, validation flow, and links to the event, node, and run-state subpages.
When To Use This Reference
Use this page when you need the exact workflow definition fields, request shape, or authoring sequence. For product concepts, start with Workflows. For constants and detailed behavior, use these subpages:
- Workflow Events lists event type IDs, provider native event IDs, subject kinds, and compatible source kinds.
- Workflow Nodes And Branches lists
agent_runandcontrolnode behavior, condition syntax, joins, fan-out, and loops. - Workflow Runs And Statuses lists run, step, delivery, retry, rerun, and output delivery states.
The live workspace API is still authoritative. A workspace can only create workflows for events and recipes returned by that workspace’s workflow-recipes and workflow-event-support endpoints, because those results account for connected integrations and linked sources.
Required Role
Workflow definition and run-control endpoints require workspace manager access. The workflow does not grant extra source permissions: the selected agent must already be assigned to the connected source that the trigger uses.
Authoring Flow
For agent-created workflows, use this sequence:
- List available recipes and event support for the workspace.
- Select a compatible source and event type from the returned descriptors.
- Select an agent that is assigned to the same source and has the tools the prompt needs.
- Build a workflow definition with stable
nodeKeyvalues. - Validate the definition before saving or enabling it.
- Save disabled first when the workflow was generated from free-form instructions.
- Enable only after validation passes and the user confirms the source, events, and prompt.
Core Definition Fields
| Field | Type | Required | Meaning |
|---|---|---|---|
name | string | Yes | Display name shown in the workflow browser. |
description | string or null | No | Optional explanation for humans. |
enabled | boolean | Yes | Whether matching events can start new runs. |
agentProfileId | GUID | Yes | Default agent for the workflow and any step that does not override the agent. |
concurrencyPolicy | string or null | No | How repeat events are handled. Defaults to Dawn’s normal policy when omitted. |
debounceSeconds | integer or null | No | Delay window used by debounce policies. Default debounce is 90 seconds. |
queueDedupeSeconds | integer or null | No | Optional duplicate window for queued workflows. Duplicate queued events for the same subject within this window collapse into one pending run. |
triggers | array | Yes | One or more workflow triggers. |
steps | array | Yes | Agent-run and control nodes. |
deliveryJson | JSON string or null | No | Reserved delivery configuration. Workspace notification delivery is always supported. |
startConfigJson | JSON string or null | No | Reserved start configuration for specialized workflows. |
layoutJson | JSON string or null | No | Canvas layout data. Does not change runtime execution. |
Concurrency Policies
| Value | Behavior |
|---|---|
queue | Keep matching events and process each run. |
skip_if_running | Ignore a new matching event while an active run exists. |
cancel_previous | Cancel existing active work before queuing the new run. |
debounce_by_subject | Collapse rapid events for the same subject into a later run. Good for pull request updates. |
queueDedupeSeconds applies to queued workflow starts. Use it when the workflow should keep queue semantics but avoid duplicate pending runs caused by repeated delivery of the same event or rapid identical updates.
Trigger Fields
| Field | Type | Required | Meaning |
|---|---|---|---|
triggerType | string | Yes | integration_event or schedule. |
provider | string | Yes | Provider ID, such as github, azure_devops, or dawn. |
connectionId | GUID or null | Usually | Workspace integration connection. Not needed for Dawn-owned system events. |
sourceId | GUID or null | Usually | Linked source that receives the event. Not needed for Dawn-owned system events. |
personalConnectionId | GUID or null | No | Personal integration connection for private workflows. |
personalResourceId | GUID or null | No | Personal integration resource for private workflows. |
eventTypes | string array or null | Integration events | Event IDs such as github.pull_request.created. |
filterJson | JSON string or null | No | Reserved provider-specific filter configuration. |
scheduleJson | JSON string or null | Schedule triggers | Schedule configuration for system schedule triggers. |
For integration workflows, eventTypes must all be supported by the selected source. For schedule workflows, use provider dawn, trigger type schedule, and event type dawn.schedule.elapsed when an event type is required by the caller.
Step Fields
| Field | Type | Required | Meaning |
|---|---|---|---|
order | integer or null | Recommended | Stable ordering for display and execution planning. |
name | string or null | Recommended | Human-readable node name. |
stepType | string | Yes | agent_run or control. |
prompt | string or null | Agent runs | Prompt sent to the agent. Can contain Prompt Commands such as /pr-review. |
settingsJson | JSON string or null | Control nodes | Control-node settings. See Workflow Nodes And Branches. |
agentProfileId | GUID or null | No | Optional step-specific agent override. |
nodeKey | string or null | Strongly recommended | Stable graph key used by dependencies and canvas state. |
dependsOn | string array or null | No | Parent node keys that must complete before this node can run. |
Use stable, readable nodeKey values such as review, security_review, summary, and notify. Do not generate random node keys unless the workflow is temporary, because condition outputs, loops, and canvas layout reference these keys.
Minimal Workflow Example
{
"name": "PR review",
"description": "Review pull requests when they are opened or updated.",
"enabled": false,
"agentProfileId": "00000000-0000-0000-0000-000000000000",
"concurrencyPolicy": "debounce_by_subject",
"debounceSeconds": 90,
"queueDedupeSeconds": null,
"triggers": [
{
"triggerType": "integration_event",
"provider": "github",
"connectionId": "11111111-1111-1111-1111-111111111111",
"sourceId": "22222222-2222-2222-2222-222222222222",
"eventTypes": [
"github.pull_request.created",
"github.pull_request.updated"
]
}
],
"steps": [
{
"order": 1,
"nodeKey": "review",
"name": "Review pull request",
"stepType": "agent_run",
"prompt": "/pr-review\n\nReview the pull request that triggered this workflow. Return findings first, with file references where possible, and say explicitly when no blocking findings are found.",
"dependsOn": []
}
]
}
Parallel Review Example
Use separate root agent_run nodes to fan out work. Add a join node before a summary step when downstream output should wait for every review branch.
{
"steps": [
{
"order": 1,
"nodeKey": "general_review",
"name": "General review",
"stepType": "agent_run",
"prompt": "Review correctness, regressions, and missing tests.",
"dependsOn": []
},
{
"order": 2,
"nodeKey": "security_review",
"name": "Security review",
"stepType": "agent_run",
"prompt": "Review authentication, authorization, secret handling, and unsafe data exposure.",
"dependsOn": []
},
{
"order": 3,
"nodeKey": "join_reviews",
"name": "Wait for reviews",
"stepType": "control",
"settingsJson": "{\"controlType\":\"join\",\"joinPolicy\":\"all_terminal\"}",
"dependsOn": ["general_review", "security_review"]
},
{
"order": 4,
"nodeKey": "summary",
"name": "Summarize review",
"stepType": "agent_run",
"prompt": "Summarize the upstream review outputs into one concise PR comment.",
"dependsOn": ["join_reviews"]
}
]
}
Validation And Save
Validate before create or update:
POST /api/v1/workspaces/{workspaceId}/workflows/validatevalidates a new definition.POST /api/v1/workspaces/{workspaceId}/workflows/{workflowId}/validatevalidates an update.POST /api/v1/workspaces/{workspaceId}/workflowscreates.PATCH /api/v1/workspaces/{workspaceId}/workflows/{workflowId}updates.
Validation returns:
| Field | Meaning |
|---|---|
valid | Whether the workflow can be saved or run. |
issues[].code | Stable validation code. |
issues[].severity | Severity string. |
issues[].targetKind | Target type, such as trigger, step, or edge. |
issues[].field | Field associated with the issue when available. |
issues[].nodeKey | Node associated with the issue when available. |
issues[].sourceNodeKey | Source node for edge issues. |
issues[].targetNodeKey | Target node for edge issues. |
issues[].message | Human-readable explanation. |
Recipe Instantiation
Recipes are provider- or system-owned starting points. They are listed by:
GET /api/v1/workspaces/{workspaceId}/workflow-recipes
Each recipe exposes:
| Field | Meaning |
|---|---|
id | Recipe ID, such as github.pr_review. |
providerId | Provider that owns the recipe. |
requiredSourceKinds | Compatible source kinds. |
triggerEventTypes | Default event type set. |
defaultConcurrencyPolicy | Default concurrency policy. |
defaultDebounceSeconds | Default debounce window. |
steps | Default step names, types, and prompt templates. |
Instantiate a recipe with:
POST /api/v1/workspaces/{workspaceId}/workflow-recipes/{recipeId}/instantiate
Request fields:
| Field | Meaning |
|---|---|
name | Optional override name. |
description | Optional override description. |
connectionId | Integration connection to use. |
sourceId | Source to use. |
agentProfileId | Agent that will run the workflow. |
eventTypes | Optional event override. Must stay compatible with the selected source. |
prompt | Optional prompt override for the recipe’s agent-run step. |
enabled | Whether the instantiated workflow should be enabled immediately. |
Safe Agent Authoring Rules
Agents that create workflows should follow these rules:
- Prefer recipes when a matching recipe exists.
- Read event support before inventing event IDs.
- Save generated workflows disabled unless the user explicitly asks to enable them.
- Use
debounce_by_subjectfor PR and issue update flows unless every event must run. - Use
queuefor scheduled reports and human-visible lifecycle events. - Use stable
nodeKeyvalues and never duplicate anodeKeyin one workflow. - Use Prompt Commands in
promptwhen the workflow should behave like a manual chat command. - Validate before saving, then show validation issues rather than guessing a fix.
- Do not create delivery targets other than the built-in workspace notification unless the target is documented for the current environment.