Strait Docs
API Reference

Workflow DAG definition and management

List workflows

GET
/v1/workflows

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Query Parameters

project_id*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflows?project_id=string"
[
  {
    "id": "string",
    "project_id": "string",
    "name": "string",
    "slug": "string",
    "description": "string",
    "enabled": true,
    "version": 0,
    "timeout_secs": 0,
    "max_concurrent_runs": 0,
    "max_parallel_steps": 0,
    "cron": "string",
    "cron_timezone": "string",
    "skip_if_running": true,
    "tags": {
      "property1": "string",
      "property2": "string"
    },
    "version_id": "string",
    "version_policy": "pin",
    "backwards_compatible": true,
    "created_by": "string",
    "updated_by": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
]

Create a workflow

POST
/v1/workflows

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "http://localhost:8080/v1/workflows" \  -H "Content-Type: application/json" \  -d '{    "project_id": "string",    "name": "string",    "slug": "string",    "steps": [      {        "step_ref": "string"      }    ]  }'
{
  "id": "string",
  "project_id": "string",
  "name": "string",
  "slug": "string",
  "description": "string",
  "enabled": true,
  "version": 0,
  "timeout_secs": 0,
  "max_concurrent_runs": 0,
  "max_parallel_steps": 0,
  "cron": "string",
  "cron_timezone": "string",
  "skip_if_running": true,
  "tags": {
    "property1": "string",
    "property2": "string"
  },
  "version_id": "string",
  "version_policy": "pin",
  "backwards_compatible": true,
  "created_by": "string",
  "updated_by": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}

Get a workflow

GET
/v1/workflows/{workflowID}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

workflowID*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflows/string"
{
  "id": "string",
  "project_id": "string",
  "name": "string",
  "slug": "string",
  "description": "string",
  "enabled": true,
  "version": 0,
  "timeout_secs": 0,
  "max_concurrent_runs": 0,
  "max_parallel_steps": 0,
  "cron": "string",
  "cron_timezone": "string",
  "skip_if_running": true,
  "tags": {
    "property1": "string",
    "property2": "string"
  },
  "version_id": "string",
  "version_policy": "pin",
  "backwards_compatible": true,
  "created_by": "string",
  "updated_by": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}

Update a workflow

PATCH
/v1/workflows/{workflowID}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

workflowID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PATCH "http://localhost:8080/v1/workflows/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "project_id": "string",
  "name": "string",
  "slug": "string",
  "description": "string",
  "enabled": true,
  "version": 0,
  "timeout_secs": 0,
  "max_concurrent_runs": 0,
  "max_parallel_steps": 0,
  "cron": "string",
  "cron_timezone": "string",
  "skip_if_running": true,
  "tags": {
    "property1": "string",
    "property2": "string"
  },
  "version_id": "string",
  "version_policy": "pin",
  "backwards_compatible": true,
  "created_by": "string",
  "updated_by": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}

Delete a workflow

DELETE
/v1/workflows/{workflowID}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

workflowID*string

Response Body

curl -X DELETE "http://localhost:8080/v1/workflows/string"
Empty

Trigger a workflow run

POST
/v1/workflows/{workflowID}/trigger

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

workflowID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "http://localhost:8080/v1/workflows/string/trigger" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "workflow_id": "string",
  "project_id": "string",
  "status": "pending",
  "triggered_by": "string",
  "workflow_version": 0,
  "max_parallel_steps": 0,
  "payload": {},
  "error": "string",
  "started_at": "2019-08-24T14:15:22Z",
  "finished_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "retry_of_run_id": "string",
  "parent_workflow_run_id": "string",
  "parent_step_run_id": "string",
  "tags": {
    "property1": "string",
    "property2": "string"
  },
  "workflow_version_id": "string",
  "created_by": "string",
  "created_at": "2019-08-24T14:15:22Z"
}

List runs for a workflow

GET
/v1/workflows/{workflowID}/runs

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

workflowID*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflows/string/runs"
[
  {
    "id": "string",
    "workflow_id": "string",
    "project_id": "string",
    "status": "pending",
    "triggered_by": "string",
    "workflow_version": 0,
    "max_parallel_steps": 0,
    "payload": {},
    "error": "string",
    "started_at": "2019-08-24T14:15:22Z",
    "finished_at": "2019-08-24T14:15:22Z",
    "expires_at": "2019-08-24T14:15:22Z",
    "retry_of_run_id": "string",
    "parent_workflow_run_id": "string",
    "parent_step_run_id": "string",
    "tags": {
      "property1": "string",
      "property2": "string"
    },
    "workflow_version_id": "string",
    "created_by": "string",
    "created_at": "2019-08-24T14:15:22Z"
  }
]

Clone a workflow

POST
/v1/workflows/{workflowID}/clone

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

workflowID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "http://localhost:8080/v1/workflows/string/clone" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "project_id": "string",
  "name": "string",
  "slug": "string",
  "description": "string",
  "enabled": true,
  "version": 0,
  "timeout_secs": 0,
  "max_concurrent_runs": 0,
  "max_parallel_steps": 0,
  "cron": "string",
  "cron_timezone": "string",
  "skip_if_running": true,
  "tags": {
    "property1": "string",
    "property2": "string"
  },
  "version_id": "string",
  "version_policy": "pin",
  "backwards_compatible": true,
  "created_by": "string",
  "updated_by": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}

Get DAG visualization

GET
/v1/workflows/{workflowID}/graph

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

workflowID*string

Query Parameters

format?string

Output format. Default is JSON adjacency list; 'dot' returns Graphviz DOT.

Value in"json" | "dot"

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflows/string/graph"
{
  "workflow_id": "string",
  "roots": [
    "string"
  ],
  "adjacency": {
    "property1": [
      "string"
    ],
    "property2": [
      "string"
    ]
  },
  "dot": "string"
}

Validate a workflow DAG structure

POST
/v1/workflows/{workflowID}/dry-run

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

workflowID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "http://localhost:8080/v1/workflows/string/dry-run" \  -H "Content-Type: application/json" \  -d '{}'
{
  "valid": true,
  "step_count": 0
}

Build topological workflow plan preview

POST
/v1/workflows/{workflowID}/plan

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

workflowID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "http://localhost:8080/v1/workflows/string/plan" \  -H "Content-Type: application/json" \  -d '{}'
{
  "workflow_id": "string",
  "workflow_version": 0,
  "step_count": 0,
  "roots": [
    "string"
  ],
  "topological_order": [
    "string"
  ]
}

List workflow versions

GET
/v1/workflows/{workflowID}/versions

Path Parameters

workflowID*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflows/string/versions"
[
  {
    "id": "string",
    "workflow_id": "string",
    "version": 0,
    "project_id": "string",
    "name": "string",
    "slug": "string",
    "description": "string",
    "enabled": true,
    "timeout_secs": 0,
    "max_concurrent_runs": 0,
    "max_parallel_steps": 0,
    "cron": "string",
    "cron_timezone": "string",
    "skip_if_running": true,
    "version_id": "string",
    "created_by": "string",
    "updated_by": "string",
    "created_at": "2019-08-24T14:15:22Z"
  }
]

Get workflow version by version ID

GET
/v1/workflows/{workflowID}/versions/{versionID}

Path Parameters

workflowID*string
versionID*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflows/string/versions/string"
{
  "id": "string",
  "workflow_id": "string",
  "version": 0,
  "project_id": "string",
  "name": "string",
  "slug": "string",
  "description": "string",
  "enabled": true,
  "timeout_secs": 0,
  "max_concurrent_runs": 0,
  "max_parallel_steps": 0,
  "cron": "string",
  "cron_timezone": "string",
  "skip_if_running": true,
  "version_id": "string",
  "created_by": "string",
  "updated_by": "string",
  "created_at": "2019-08-24T14:15:22Z"
}

List workflow version steps

GET
/v1/workflows/{workflowID}/versions/{versionID}/steps

Path Parameters

workflowID*string
versionID*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflows/string/versions/string/steps"
[
  {
    "job_id": "string",
    "step_ref": "string",
    "depends_on": [
      "string"
    ],
    "condition": {},
    "on_failure": "fail_workflow",
    "payload": {},
    "step_type": "job",
    "approval_timeout_secs": 0,
    "approval_approvers": [
      "string"
    ],
    "retry_max_attempts": 0,
    "retry_backoff": "exponential",
    "retry_initial_delay_secs": 0,
    "retry_max_delay_secs": 0,
    "timeout_secs_override": 0,
    "output_transform": "string",
    "sub_workflow_id": "string",
    "max_nesting_depth": 0,
    "event_key": "string",
    "event_timeout_secs": 0,
    "event_notify_url": "string",
    "sleep_duration_secs": 0,
    "event_emit_key": "string",
    "concurrency_key": "string",
    "resource_class": "small"
  }
]

Get workflow run labels

GET
/v1/workflow-runs/{workflowRunID}/labels

Path Parameters

workflowRunID*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflow-runs/string/labels"
{
  "labels": {
    "property1": "string",
    "property2": "string"
  }
}

Get workflow run graph

GET
/v1/workflow-runs/{workflowRunID}/graph

Path Parameters

workflowRunID*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflow-runs/string/graph"
{
  "workflow_run_id": "string",
  "workflow_id": "string",
  "version": 0,
  "nodes": [
    {
      "step_ref": "string",
      "type": "job",
      "status": "pending",
      "depends_on": [
        "string"
      ],
      "attempt": 0,
      "started_at": "2019-08-24T14:15:22Z",
      "finished_at": "2019-08-24T14:15:22Z",
      "duration_ms": 0
    }
  ],
  "edges": [
    {
      "from": "string",
      "to": "string"
    }
  ],
  "roots": [
    "string"
  ],
  "runnable": [
    "string"
  ],
  "critical_path": [
    "string"
  ],
  "critical_path_estimate_ms": 0,
  "critical_path_remaining_ms": 0
}

List workflow step decisions

GET
/v1/workflow-runs/{workflowRunID}/explain

Path Parameters

workflowRunID*string

Query Parameters

step_ref?string
decision_type?string
Value in"scheduler" | "concurrency" | "resource" | "condition"

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflow-runs/string/explain"
{
  "data": [
    {
      "id": "string",
      "workflow_run_id": "string",
      "step_run_id": "string",
      "step_ref": "string",
      "decision_type": "scheduler",
      "decision": "string",
      "explanation": "string",
      "details": {},
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "next_cursor": "string",
  "has_more": true
}

Get workflow run timeline for Gantt chart rendering

GET
/v1/workflow-runs/{workflowRunID}/timeline

Path Parameters

workflowRunID*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflow-runs/string/timeline"
{
  "workflow_run_id": "string",
  "status": "string",
  "started_at": "2019-08-24T14:15:22Z",
  "finished_at": "2019-08-24T14:15:22Z",
  "total_ms": 0,
  "steps": [
    {
      "step_run_id": "string",
      "step_ref": "string",
      "status": "string",
      "started_at": "2019-08-24T14:15:22Z",
      "finished_at": "2019-08-24T14:15:22Z",
      "duration_ms": 0,
      "parallel_with": [
        "string"
      ],
      "on_critical_path": true,
      "wait_ms": 0
    }
  ]
}

Simulate workflow execution

POST
/v1/workflows/{workflowID}/simulate

Path Parameters

workflowID*string

Response Body

application/json

curl -X POST "http://localhost:8080/v1/workflows/string/simulate"
{
  "workflow_id": "string",
  "version": 0,
  "predicted_order": [
    "string"
  ],
  "step_count": 0
}

Diff workflow versions

GET
/v1/workflows/{workflowID}/versions/{fromVersionID}/diff/{toVersionID}

Path Parameters

workflowID*string
fromVersionID*string
toVersionID*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflows/string/versions/string/diff/string"
{
  "from_version_id": "string",
  "to_version_id": "string",
  "added_steps": [
    "string"
  ],
  "removed_steps": [
    "string"
  ]
}

Workflow version impact

GET
/v1/workflows/{workflowID}/versions/{versionID}/impact

Path Parameters

workflowID*string
versionID*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflows/string/versions/string/impact"
{
  "version_id": "string",
  "matching_runs": 0,
  "sampled_runs": 0
}

List active workflow versions

GET
/v1/workflows/{workflowID}/active-versions

Path Parameters

workflowID*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflows/string/active-versions"
{
  "workflow_id": "string",
  "versions": [
    {
      "version_id": "string",
      "version": 0,
      "pending": 0,
      "running": 0,
      "paused": 0,
      "total": 0
    }
  ]
}

Get workflow policy

GET
/v1/workflow-policies/{projectID}

Path Parameters

projectID*string

Response Body

application/json

curl -X GET "http://localhost:8080/v1/workflow-policies/string"
{
  "id": "string",
  "project_id": "string",
  "max_fan_out": 0,
  "max_depth": 0,
  "forbidden_step_types": [
    "string"
  ],
  "require_approval_for_deploy": true,
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}

Upsert workflow policy

PUT
/v1/workflow-policies/{projectID}

Path Parameters

projectID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PUT "http://localhost:8080/v1/workflow-policies/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "project_id": "string",
  "max_fan_out": 0,
  "max_depth": 0,
  "forbidden_step_types": [
    "string"
  ],
  "require_approval_for_deploy": true,
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
Was this page helpful?