Skip to content

Publish workflow

POST
/api/v1/workflows/{id}/publish
Code sample: cURL
curl -X POST 'https://api.justcrawl.io/api/v1/workflows/a47ac10b-58cc-4372-a567-0e02b2c3d479/publish' \
-H 'Authorization: Bearer $JUSTCRAWL_API_KEY'

Validate the workflow’s latest version and flip its status to published. Once published, the workflow is eligible to receive dispatched scrape jobs (resolution still depends on route). Returns 400 with validationErrors if the DAG fails structural validation — re-edit, fix the errors, then retry.

Set the route before you publish. POST /api/v1/workflows creates the workflow with route: "*" (the org-wide default route), and only ONE published workflow per org may hold any given route. So the second workflow you ever publish will 409 unless you first give it its own route via PUT /api/v1/workflows/{id}/routing — or unpublish whichever workflow currently holds the one you want.

id
required
string format: uuid

The workflow’s stable logical id — the workflowId field of a workflow object, NOT its id field. id is the per-version row key and 404s here.

Workflow status flipped to published.

Media typeapplication/json
object
workflowId
string format: uuid
status
string
Allowed values: published
Example
{
"status": "published"
}

Workflow DAG has validation errors that prevented publish. Body includes a validationErrors array.

Media typeapplication/json
object
error
string
validationErrors
Array<object>
object
Examplegenerated
{
"error": "example",
"validationErrors": [
{}
]
}

Missing or invalid authentication token

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

Insufficient permissions for this operation

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

Resource not found

Media typeapplication/json
object
error
string
Example
{
"error": "Workflow not found"
}

Another published workflow in this org already holds this workflow’s route. Give this workflow a different route with PUT /api/v1/workflows/{id}/routing, or unpublish the one that holds it.

Media typeapplication/json
object
error
string
Examplegenerated
{
"error": "example"
}

Unexpected server error. Logs and PostHog $exception capture

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