Skip to content
DhvaneeDocs
Dashboard
On this page

Automations API

Create an automation draft, publish it, start it on demand with a Manual trigger and follow the run.

An automation is a workflow of steps that starts from a trigger and runs on its own. This API creates and edits the draft of an automation, publishes it, starts a run on demand and reports how the run is going. Everything is scoped to the workspace that owns the key. Connections and templates are managed in the dashboard; see Automations.

The machine-readable contract is openapi.public.yaml. Download it for clients and codegen. This site has no live Try-it console.
Only an automation with a Manual trigger (automation.trigger.manual.v1) can be started through this API. You can create and publish automations with any trigger, but those start from their own trigger (a schedule, a form, a webhook and so on). There is no endpoint to delete or archive an automation, to list runs, to read the output of a step, or to create a connection. Do those in the dashboard.

Scopes

  • automations:read for GET (list, get one, get a run)
  • automations:write for create, update, activate and start a run

Publishable keys (dhvanee_pub_) hold read scopes only: they can call the GET endpoints, and a write answers 403. A key only works on the environment where it was created. See Authentication.

Endpoints

Method and pathWhat it doesScopeIdempotency-Key
GET /v1/automationsList automationsautomations:readNo
POST /v1/automationsCreate a draft (returns 201)automations:writeRequired
GET /v1/automations/{id}Get one automationautomations:readNo
PATCH /v1/automations/{id}Rename it or replace its draft graphautomations:writeNo
POST /v1/automations/{id}/activatePublish the draft and turn it onautomations:writeNo
POST /v1/automations/{id}/runsStart a run (returns 202)automations:writeRequired
GET /v1/automations/runs/{run_id}Get a run to follow its progressautomations:readNo

The automation object

FieldTypeNotes
idstring (UUID)Set by Dhvanee. The other calls use it.
namestring1 to 200 characters.
statestringdraft before the first activation, then active. paused and archived are set in the dashboard.
revisionintegerGoes up on every edit and on activation.
draft_revisionintegerGoes up on every edit of the draft.
active_version_idstring or nullThe published version that runs. null until the first activation.
graphobjectThe draft graph, not the published one. See the graph section below.
created_at, updated_atstring or nullISO 8601.
{
  "id": "3f0c1e2a-6b1d-4c1e-9a52-2d7f0b9e4c11",
  "name": "Greeter",
  "state": "draft",
  "revision": 1,
  "draft_revision": 1,
  "active_version_id": null,
  "graph": { "schema_version": 2, "nodes": [ ... ], "edges": [ ... ] },
  "created_at": "2026-11-20T10:00:00+00:00",
  "updated_at": "2026-11-20T10:00:00+00:00"
}

List automations

Newest first, without archived ones. The only option is limit: 1 to 100, default 50. A value outside that range is clamped rather than rejected, and a value that is not a whole number returns 422. There is no paging, search, status filter or sort, so a call returns at most 100 automations. Each item carries its full draft graph.

curl -sS -X GET "https://api.stage.dhvanee.com/v1/automations?limit=50" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY"
{"items": [{"id": "3f0c1e2a-...", "name": "Greeter", "state": "draft", "revision": 1, "draft_revision": 1, "active_version_id": null, "graph": {"schema_version": 2, "nodes": [], "edges": []}, "created_at": "2026-11-20T10:00:00+00:00", "updated_at": "2026-11-20T10:00:00+00:00"}]}

The graph

A graph is a list of nodes (the trigger and the steps) and a list of edges that connect them. Send schema_version: 2. Without it Dhvanee assumes the older version 1 shape, which is only kept for automations that already exist.

PartRule
schema_version2.
nodes[].idYour own name for the node: a letter first, then letters, digits and _, up to 64 characters. Unique in the graph. Other steps refer to the node by this id.
nodes[].typeWhat the node does, for example automation.trigger.manual.v1. Lower case words joined by dots and ending in a version such as .v1, up to 64 characters.
nodes[].configAn object with the node's settings. It depends on the node type. Optional while saving a draft, required fields are checked when you publish.
nodes[].settingsOptional. What a run does with the step's items and failures (the Settings tab in the editor).
edges[].from, edges[].toNode ids.
edges[].portThe output of the from node, 1 to 32 characters. Most nodes have one output called next.
edges[].kindOptional. main (the default) carries items from step to step. ai_model, ai_output_parser, ai_memory and ai_tool attach a part to an AI step, and then port must be the same word as kind.

Size limits: at most 50 nodes, 100 edges and 256 KiB. Keys that are not listed above are rejected on the graph, on a node and on an edge.

Node types and settings. The quickest way to get a correct node is to build the step once in the dashboard editor, read the automation with GET /v1/automations/{id}, and copy the node from its graph. The same shape goes back in through POST and PATCH.

Values from earlier steps. Text that contains {{ }} is written as {"$text": "Hi {{ $json.payload.name }}"}. Inside {{ }} use the same syntax as the dashboard: $json.field is the item the previous step handed on, $('set').item.json.field is the item of the node whose id is set, and $execution.id and $now give run data. In this API the name inside $('...') is the node's id. A reference to an id that is not in the graph is refused when you publish (A referenced node no longer exists.). See Automations for the helper functions.

Saving a draft is lenient and publishing is strict. A draft can be incomplete: no trigger, missing settings, a node type that is not known, or an edge to a node that is not there. A draft is refused only for a broken shape (the rules above) or a connection that is not yours. Whether the graph can run is checked when you activate it.

Create an automation

Send a name (1 to 200 characters, not only spaces) and a graph. The result is a draft, nothing runs until you activate it. The request needs an Idempotency-Key, see the Idempotency-Key section below.

FieldTypeNotes
namestringRequired.
graphobjectRequired. A graph as described above.

A node that uses a connection (an HTTP request or an app action, for example) carries the connection's connection_id in its config. Connections cannot be created or changed through the API: the id must be a UUID of an active connection that already exists in your workspace.

curl -sS -X POST "https://api.stage.dhvanee.com/v1/automations" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY" \
  -H "Idempotency-Key: 5d0e8f2a-1c3b-4e7a-9d21-0a6b7c8d9e10" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Greeter",
  "graph": {
    "schema_version": 2,
    "nodes": [
      {"id": "trigger", "type": "automation.trigger.manual.v1", "config": {}},
      {"id": "set", "type": "automation.core.edit_fields.v1",
       "config": {"fields": [{"name": "greeting", "value": {"$text": "Hi {{ $json.payload.name }}"}}]}},
      {"id": "end", "type": "automation.form.ending.v1", "config": {"title": "Done", "message": "ok"}}
    ],
    "edges": [
      {"from": "trigger", "port": "next", "to": "set"},
      {"from": "set", "port": "next", "to": "end"}
    ]
  }
}'

Returns 201 with the new automation, in the draft state, as in the object above. This example graph is complete and can be activated as it is.

Saving a graph that is not valid returns 422. These are the plain-text reasons:

Reason (`422`)Meaning
Workflow name must be between 1 and 200 charactersThe name is empty after trimming spaces.
Graph must be at most 256 KiBThe graph is too large.
Action connection_id must be a UUIDA node's connection_id is not a UUID.
Graph references a missing or inaccessible connectionA connection_id is not an active connection of this workspace.
Graph is not valid. nodes.0.id: ...A shape rule failed: an unknown key, a wrong id or type pattern, more than 50 nodes or 100 edges, or an unknown edge kind. The text lists up to three problems as path: reason and says how many more there are.

Get an automation

curl -sS -X GET "https://api.stage.dhvanee.com/v1/automations/AUTOMATION_ID" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY"

Returns the same fields as the create response. graph is always the draft, also for an active automation, so you see the latest edits even before you activate them. An archived automation can still be read.

Update the draft

PATCH takes name, graph or both. A graph replaces the whole draft, it is not merged. Send at least one of them: an empty body {} returns 422 (At least one field must be provided). The same rules as for create apply to both fields. Both revision and draft_revision go up by one on every successful call.

curl -sS -X PATCH "https://api.stage.dhvanee.com/v1/automations/AUTOMATION_ID" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Greeter v2"}'
  • Editing an active automation changes the draft only. The running version stays as it was until you activate again.
  • An archived automation cannot be edited (409, Archived workflows cannot be edited).
  • If another request edited the automation at the same moment you get 409 (Workflow was modified by another request). Read it again and retry.

Activate

Publishes the current draft as a new version and turns the automation on. The response is the automation with state: active and the new active_version_id. Activating a draft that has not changed since the last activation returns the same active_version_id and does not add a version.

curl -sS -X POST "https://api.stage.dhvanee.com/v1/automations/AUTOMATION_ID/activate" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY"
{
  "id": "3f0c1e2a-6b1d-4c1e-9a52-2d7f0b9e4c11",
  "name": "Greeter",
  "state": "active",
  "revision": 2,
  "draft_revision": 1,
  "active_version_id": "7b9e5d10-2c3a-4f5e-8d6b-1a2b3c4d5e6f",
  "graph": { "schema_version": 2, "nodes": [ ... ], "edges": [ ... ] },
  "created_at": "2026-11-20T10:00:00+00:00",
  "updated_at": "2026-11-20T10:05:00+00:00"
}

If the graph cannot be published the call returns 422 and one plain message, the first problem found. Fix it and call again. The graph has to pass all of these:

RuleMessage (`422`)
At least one supported triggerAdd a supported trigger.
At least two nodes, at most 50Draft does not satisfy the executable graph v1 schema. (for a version 2 graph the text says v2)
Every node type is known and ready to runThis node definition is unavailable.
Required settings are filled inconfig/connection_id is required (the name of the missing setting changes)
Nodes that use a connection point to an active connection of this workspace, for the right appChoose an active connection owned by this workspace.
Every output of a node is connected, only through ports the node has, one edge per portConnect the required outputs using valid ports.
Every node except a trigger has an incoming edge, and a trigger has noneThis node needs an incoming connection.
Every node can be reached from a triggerThis node is not connected to a trigger.
No loopsWorkflow connections cannot form a loop.
Every route from a trigger to its end passes exactly one Form Ending node (automation.form.ending.v1), whatever the triggerEvery form route must display one Form Ending. or A form route displays more than one ending.
References point to nodes that exist and run earlier on every routeA referenced node no longer exists. or The referenced step must run before this value is evaluated on every route.
Node ids are uniqueNode IDs must be unique.

Activating an archived automation returns 409 (Archived workflows cannot be published). If the draft was edited while you published, the call returns 409 (Workflow draft revision is stale); activate again.

Start a run

A run needs an active automation that has a Manual trigger, otherwise the call returns 409. Send a JSON body, even if it is only {}: a request without a body returns 422. The request needs an Idempotency-Key.

FieldTypeNotes
payloadobjectOptional, {} by default. The input of the trigger, up to 64 KiB of JSON. Steps read it as $json.payload.<field>, for example {{ $json.payload.name }}.
trigger_node_idstringOptional, 1 to 64 characters. The id of the Manual trigger to start. Needed only when the published graph has more than one Manual trigger.
curl -sS -X POST "https://api.stage.dhvanee.com/v1/automations/AUTOMATION_ID/runs" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY" \
  -H "Idempotency-Key: 8c1f4b6e-2a9d-4f3c-b7e5-6d0a1c2e3f40" \
  -H "Content-Type: application/json" \
  -d '{"payload": {"name": "Asha"}}'

The call does not wait for the result. It returns 202 straight away with the run in waiting_event, pinned to the version that was active at that moment. Edits and activations made later do not change this run. Poll the run to follow it.

{
  "id": "a1b2c3d4-0000-4000-8000-000000000001",
  "workflow_id": "3f0c1e2a-6b1d-4c1e-9a52-2d7f0b9e4c11",
  "version_id": "7b9e5d10-2c3a-4f5e-8d6b-1a2b3c4d5e6f",
  "state": "waiting_event",
  "is_test": false,
  "created_at": "2026-11-23T09:00:00+00:00",
  "started_at": null,
  "finished_at": null
}
ProblemStatus and message
The automation is not active (a draft, paused or archived one), or has no Manual trigger, or trigger_node_id is not a Manual trigger of the published graph409 Only an active automation with a Manual trigger can be run on demand
Several Manual triggers and no trigger_node_id422 This automation has more than one Manual trigger: send trigger_node_id with the node id of the one to run
payload is not valid JSON or is larger than 64 KiB422 Payload must be valid JSON or Payload exceeds 64 KiB
payload is not an object, or the body is missing422 with a list of field errors
The plan's automation executions are used up402, see Plan and limits below

Follow a run

Poll every few seconds until state is final. The response has the same fields as the start response, with started_at and finished_at filled in once the run has moved on.

curl -sS -X GET "https://api.stage.dhvanee.com/v1/automations/runs/RUN_ID" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY"
{
  "id": "a1b2c3d4-0000-4000-8000-000000000001",
  "workflow_id": "3f0c1e2a-6b1d-4c1e-9a52-2d7f0b9e4c11",
  "version_id": "7b9e5d10-2c3a-4f5e-8d6b-1a2b3c4d5e6f",
  "state": "succeeded",
  "is_test": false,
  "created_at": "2026-11-23T09:00:00+00:00",
  "started_at": "2026-11-23T09:00:01+00:00",
  "finished_at": "2026-11-23T09:00:03+00:00"
}
`state`Meaning
waiting_event, queued, runningOn its way or in progress.
waiting_responsePaused until a person or a called party answers.
succeededFinished without problems. Final.
failedStopped with an error. Final.
ambiguousThe result could not be confirmed. Final.
cancelled, skippedStopped, or not needed. Final.

is_test is true for runs started with Run test in the editor. They can be read here too. The response tells you how the run ended, not what each step produced: open the run in the dashboard to see step results.

Idempotency-Key

POST /v1/automations and POST /v1/automations/{id}/runs need an Idempotency-Key header, so a retry after a timeout never creates a second automation or run.

  • Format: 1 to 128 printable ASCII characters, no spaces. A random UUID is a good key.
  • One key per action: generate a new key for each automation or run you want, and reuse it only to retry that same request.
  • Create: the key belongs to the API key and is remembered for 24 hours. The same key with the same body returns the original 201 and body again. The same key with a different body returns 409 (Idempotency-Key was already used with a different request).
  • Run: the key belongs to the automation and is remembered for as long as the run's history is kept (see your plan). The same key with the same payload returns the same run again with 202 and does not start another, and it does not use another execution. The same key with a different payload returns 409 (Idempotency-Key was already used with a different payload). If the automation was paused since, a repeat returns 409. Use a new key for every new run.
  • Missing or malformed key: create returns 422 in both cases (Idempotency-Key is required, Idempotency-Key must be 1-128 printable ASCII characters). A run returns 428 when the key is missing (Idempotency-Key is required) and 400 when it is malformed (Idempotency-Key must be 1-128 printable ASCII characters).

Plan and limits

  • Executions. Every new run uses one automation execution of your plan. Creating, editing and activating do not. A repeated Idempotency-Key does not use another one. Check what is left with the Account API.
  • Out of executions. A new run returns 402 with {"detail": {"code": "automation_executions_limit_reached"}}, or the code wallet_empty when your plan sells extra executions and the wallet is empty, or workspace_inactive when the workspace is not active. The check comes before the state check, so it can also answer a call for a draft. See Credits.
  • Rate limits. Each key may send 60 requests a minute and the whole workspace 300. Over a limit the answer is 429 with a Retry-After header and {"detail": {"code": "rate_limit_key", "message": "Too many requests"}}. The code is rate_limit_workspace, rate_limit_client or rate_limit_auth_fail for the other limits. See Rate limits.

Errors

Errors return JSON with a detail field. A 422 from the request body is a list of field errors. A 402 and a 429 carry an object with a code. For every status across the API see Errors.

StatusWhen`detail`
400A run with a malformed Idempotency-KeyIdempotency-Key must be 1-128 printable ASCII characters
401No key, or an unknown or revoked keyValid API key is required when missing or not a Dhvanee key, API key is invalid or revoked when unknown, revoked or from another environment
402No automation executions left, empty wallet, or an inactive workspaceAn object with the code automation_executions_limit_reached, wallet_empty or workspace_inactive
403The key lacks the scope, or a publishable key tries to writeAPI key needs automations:write scope (or automations:read), Publishable API keys cannot use this scope
404No such automation or run in this workspaceAutomation not found, Run not found
409A run on an automation that is not active with a Manual trigger, an archived automation, a stale draft, or an Idempotency-Key reused with a different bodyOnly an active automation with a Manual trigger can be run on demand, Archived workflows cannot be edited, Archived workflows cannot be published, Workflow was modified by another request, Workflow draft revision is stale, Idempotency-Key was already used with a different request (create), Idempotency-Key was already used with a different payload (run)
422An invalid name or graph, an empty update, a missing body, a malformed create key, a payload that is too large, or an id that is not a UUIDA list of field errors for the body and the path, or one of the plain messages above
428A run without an Idempotency-KeyIdempotency-Key is required
429Too many requestsAn object with the code rate_limit_key, rate_limit_workspace, rate_limit_client or rate_limit_auth_fail, and a Retry-After header
curl -sS -X GET "https://api.stage.dhvanee.com/v1/automations/00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY"
{"detail": "Automation not found"}

Voice agents are managed with the Agents API. To draft an automation with the workspace copilot, see the Copilot API. Limits and keys: Authentication, Rate limits.