Knowledge CenterAPI ReferencesDalil MCPClaude Skills

Workflows

A Workflow is a container; all logic (trigger + steps) lives inside a Workflow Version, and every execution is a Workflow Run. Read everything through REST; lifecycle operations (activate, deactivate, draft, run) go through GraphQL.

MethodPathDescription
POST/rest/workflowsCreate a workflow container
GET/rest/workflows/{id}Get a workflow (depth=1 includes versions)
GET/rest/workflowsList workflows
PATCH/rest/workflows/{id}Rename a workflow
DELETE/rest/workflows/{id}Delete (cascades to versions and runs)
GET/rest/workflowVersionsList versions (trigger + steps JSON)
GET/rest/workflowRunsList runs with execution state
POST/graphqlActivate, deactivate, draft, run, templates
POST/rest/workflows

Create the workflow container. This holds no logic by itself: create a version next to define the trigger and steps.

Body

namerequiredstring

Workflow name

Requestcurl
# 1. Create the container
curl -X POST "https://app.usedalil.ai/rest/workflows" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Lead Nurture" }'

# 2. Create a draft version for it
curl -X POST "https://app.usedalil.ai/rest/workflowVersions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "v1", "workflowId": "workflow-uuid" }'
GET/rest/workflows/{id}

Retrieve a workflow. depth=1 includes its versions; depth=2 also includes each version's trigger and steps.

Parameters

idrequiredUUID

Workflow ID

depthnumber

1 = include versions, 2 = include trigger + steps

Requestcurl
curl -G "https://app.usedalil.ai/rest/workflows/workflow-uuid" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "depth=2"
GET/rest/workflows

List workflows. The statuses field aggregates version statuses (DRAFT, ACTIVE, DEACTIVATED).

Parameters

limitnumber

Records per page (default 60)

filterstring

e.g. statuses[like]:ACTIVE

order_bystring

Sort field and direction

Requestcurl
curl -G "https://app.usedalil.ai/rest/workflows" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "filter=statuses[like]:ACTIVE" \
  --data-urlencode "order_by=createdAt[DescNullsLast]"
GET/rest/workflowVersions

List or fetch versions. A version's status is DRAFT, ACTIVE, DEACTIVATED, or ARCHIVED. Once ACTIVE, its trigger and steps are frozen.

Parameters

filterstring

e.g. workflowId[eq]:{id},status[eq]:DRAFT

depthnumber

1 = include trigger and steps JSON

Requestcurl
curl -G "https://app.usedalil.ai/rest/workflowVersions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "filter=workflowId[eq]:workflow-uuid" \
  --data-urlencode "depth=1"
GET/rest/workflowRuns

List runs. Each run records which version executed, timing, status, and the full execution state including per-step outputs.

💡 state.stepInfos is keyed by step UUID. Correlate names to ids via state.flow.steps to read a specific step's output.

Parameters

filterstring

e.g. workflowId[eq]:{id} or status[eq]:FAILED

order_bystring

e.g. createdAt[DescNullsLast]

depthnumber

1 = include full state object

Requestcurl
curl -G "https://app.usedalil.ai/rest/workflowRuns" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "filter=workflowId[eq]:workflow-uuid" \
  --data-urlencode "order_by=createdAt[DescNullsLast]" \
  --data-urlencode "depth=1"

Lifecycle (GraphQL)

All lifecycle operations go through POST /graphql. Only one version can be ACTIVE per workflow; activating a new version automatically deactivates the previous one.

Activate or deactivate a version

mutation ActivateWorkflowVersion($workflowVersionId: UUID!) {
  activateWorkflowVersion(workflowVersionId: $workflowVersionId)
}

mutation DeactivateWorkflowVersion($workflowVersionId: UUID!) {
  deactivateWorkflowVersion(workflowVersionId: $workflowVersionId)
}

Edit a published workflow (create a draft)

mutation CreateDraftFromWorkflowVersion($input: CreateDraftFromWorkflowVersionInput!) {
  createDraftFromWorkflowVersion(input: $input) {
    id name status trigger steps
  }
}

# input
{
  "workflowId": "workflow-uuid",
  "workflowVersionIdToCopy": "source-version-uuid"
}

Versions are immutable once activated. This mutation copies the trigger and steps into a new editable DRAFT.

Trigger a manual run

mutation RunWorkflowVersion($input: RunWorkflowVersionInput!) {
  runWorkflowVersion(input: $input) { workflowRunId }
}

# input
{
  "workflowVersionId": "version-uuid",
  "payload": { "customField": "value" },
  "objectNameSingular": "person",
  "recordId": "record-uuid"
}

Only ACTIVE versions can run. For MANUAL triggers, the payload becomes the {{trigger.*}} variable source for the run.

Apply a template

mutation CreateWorkflowFromTemplate($input: CreateWorkflowFromTemplateInput!) {
  createWorkflowFromTemplate(input: $input) {
    success workflowId workflowVersionId stepsCreated
  }
}

# templateType values:
#   DEAL_FROM_PERSON            create an opportunity from a person
#   DEAL_FROM_COMPANY           create an opportunity from a company
#   CUSTOMER_SUCCESS_HANDOFF    handoff on opportunity stage change
#   INBOUND_LEAD_TRIAGE         route and qualify inbound leads

Reading Run State

A run's state object contains the executed flow, per-step outputs, and any error:

{
  "flow": { "trigger": { }, "steps": [ ] },
  "stepInfos": {
    "step-uuid": { "status": "SUCCESS", "output": { } }
  },
  "workflowRunError": null,
  "triggerUserName": "Alice Smith"
}

# Quick status check with jq
curl -sG "https://app.usedalil.ai/rest/workflowRuns/run-uuid" \
  --data-urlencode "depth=1" \
  -H "Authorization: Bearer YOUR_API_KEY" | \
  jq '{ status: .data.workflowRun.status,
        error: .data.workflowRun.state.workflowRunError }'

Common Gotchas

  • Workflow ≠ Version: POST /rest/workflows creates only the container; create a workflowVersion separately to have something to edit.
  • You cannot PATCH trigger or steps via REST; step editing goes through GraphQL mutations.
  • Running a DRAFT version returns an error; activate it first.
  • Deleting a workflow permanently removes all versions and runs; there is no soft delete.
  • Response wrappers follow the path segment: .data.workflow, .data.workflowVersions, .data.workflowRuns.
← PREVIOUSSequences
NEXT →Inbox & Messages

Was this page helpful?

Your feedback helps us improve our documentation.