Skip to content

Create workflow

POST
/api/v1/workflows
curl -X POST 'https://dashboard.justcrawl.io/api/v1/workflows' \
-H 'Authorization: Bearer $JUSTCRAWL_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"name":"My workflow","dag":{"nodes":[{"id":"entry","type":"entry"},{"id":"svc","type":"service","providerId":"brightdata"},{"id":"out","type":"result"}],"edges":[{"from":"entry","to":"svc"},{"from":"svc","to":"out"}]}}'

Create a new workflow with a name and DAG definition. The DAG is validated server-side via validate() before persistence; structural errors return 400 with a validationErrors array enumerating each problem. New workflows start in draft status — call POST /api/v1/workflows/{id}/publish to make them live. Set autoGenerated: true if the DAG was emitted by an auto-workflow builder; this surfaces the “Run benchmark to optimize” CTA in the dashboard.

Media type application/json
object
name
required

Display name for the workflow.

string
dag
required
object
nodes
required
Array<object>
object
id
required
string
type
required
string
Allowed values: entry service split result failed
config
object
edges
required
Array<object>
object
id
required
string
from
required
string
to
required
string
type
required
string
Allowed values: default success fail split
autoGenerated

Optional. Marks the workflow as emitted by an auto-workflow builder so the dashboard can surface the “Run benchmark” CTA.

boolean

The created workflow.

Media type application/json
object
workflowId
string format: uuid
name
string
status
string
Allowed values: draft published
version
integer
route
string
nullable
dag
object
nodes
required
Array<object>
object
id
required
string
type
required
string
Allowed values: entry service split result failed
config
object
edges
required
Array<object>
object
id
required
string
from
required
string
to
required
string
type
required
string
Allowed values: default success fail split
costPerThousand
number
nullable
smart
object
strategy
string
Allowed values: success cost reliability
mode
string
Allowed values: auto suggest
domain
string
nullable
hasPendingSuggestion
boolean
createdAt
string format: date-time
Example
{
"status": "draft",
"dag": {
"nodes": [
{
"type": "entry"
}
],
"edges": [
{
"type": "default"
}
]
},
"smart": {
"strategy": "success",
"mode": "auto"
}
}

Missing or invalid name or dag field, or the DAG failed structural validation. Body includes validationErrors when DAG validation failed.

Media type application/json
object
error
string
validationErrors
Array<object>
object
Example generated
{
"error": "example",
"validationErrors": [
{}
]
}

Missing or invalid authentication token

Media type application/json
object
error
string
Example
{
"error": "Missing or invalid authentication token"
}

Insufficient permissions for this operation

Media type application/json
object
error
string
Example
{
"error": "No organization. Complete onboarding first."
}

Unexpected server error. Logs and PostHog $exception capture

Media type application/json
object
error
string
Example
{
"error": "Something went wrong"
}