Skip to content
View as Markdown

Workflow Commands ​

Commands for managing workflows and workflow executions.

In the human-readable output of --logs on workflow start, workflow wait, workflow executions, and workflow resume, [PLATFORM] marks log lines the Platform added. See function logs for the source that --json reports for each log entry.

workflow ​

Manage workflows and workflow executions.

Usage

tailor workflow [command]

See Global Options for options available to all commands.

Commands

CommandDescription
workflow listList all workflows in the workspace.
workflow getGet workflow details.
workflow startStart a workflow execution.
workflow waitWait for a workflow execution.
workflow executionsList or get workflow executions.
workflow resumeResume a failed or pending workflow execution.

workflow list ​

List all workflows in the workspace.

Usage

tailor workflow list [options]

Options

OptionAliasDescriptionRequiredDefaultEnv
--workspace-id <WORKSPACE_ID>-wWorkspace IDNo-TAILOR_PLATFORM_WORKSPACE_ID
--profile <PROFILE>-pWorkspace profileNo-TAILOR_PLATFORM_PROFILE
--order <ORDER>-Sort order (asc or desc)No"desc"-
--limit <LIMIT>-lMaximum number of items to return (0 or omit: unlimited)No--

See Global Options for options available to all commands.

workflow get ​

Get workflow details.

Usage

tailor workflow get [options] <name>

Arguments

ArgumentDescriptionRequired
nameWorkflow nameYes

Options

OptionAliasDescriptionRequiredDefaultEnv
--workspace-id <WORKSPACE_ID>-wWorkspace IDNo-TAILOR_PLATFORM_WORKSPACE_ID
--profile <PROFILE>-pWorkspace profileNo-TAILOR_PLATFORM_PROFILE

See Global Options for options available to all commands.

workflow start ​

Start a workflow execution.

Usage

tailor workflow start [options] <name>

Arguments

ArgumentDescriptionRequired
nameWorkflow nameYes

Options

OptionAliasDescriptionRequiredDefaultEnv
--workspace-id <WORKSPACE_ID>-wWorkspace IDNo-TAILOR_PLATFORM_WORKSPACE_ID
--profile <PROFILE>-pWorkspace profileNo-TAILOR_PLATFORM_PROFILE
--config <CONFIG>-cPath to Tailor config fileNo"tailor.config.ts"TAILOR_CONFIG_PATH
--machine-user <MACHINE_USER>-mMachine user name. Falls back to the active profile's default machine user.No-TAILOR_PLATFORM_MACHINE_USER_NAME
--arg <ARG>-aWorkflow argument (JSON string)No--
--wait-WWait for execution to completeNofalse-
--interval <INTERVAL>-iPolling interval when waiting (e.g., '3s', '500ms', '1m')No"3s"-
--timeout <TIMEOUT>-tMaximum time to wait (e.g., '30s', '10m')No"10m"-
--until <UNTIL>-uWait target (success, suspended, terminal)No"terminal"-
--logs-lDisplay job execution logs after completionNofalse-

See Global Options for options available to all commands.

Usage Examples:

bash
# Start a workflow
tailor workflow start my-workflow -m admin-machine-user

# Start with argument
tailor workflow start my-workflow -m admin -a '{"userId": "123"}'

# Start and wait for completion
tailor workflow start my-workflow -m admin -W

workflow wait ​

Wait for a workflow execution.

Usage

tailor workflow wait [options] <execution-id>

Arguments

ArgumentDescriptionRequired
execution-idExecution IDYes

Options

OptionAliasDescriptionRequiredDefaultEnv
--workspace-id <WORKSPACE_ID>-wWorkspace IDNo-TAILOR_PLATFORM_WORKSPACE_ID
--profile <PROFILE>-pWorkspace profileNo-TAILOR_PLATFORM_PROFILE
--interval <INTERVAL>-iPolling interval when waiting (e.g., '3s', '500ms', '1m')No"3s"-
--timeout <TIMEOUT>-tMaximum time to wait (e.g., '30s', '10m')No"10m"-
--until <UNTIL>-uWait target (success, suspended, terminal)No"terminal"-
--logs-lDisplay job execution logs after completionNofalse-

See Global Options for options available to all commands.

Examples

Wait for workflow success

bash
$ tailor workflow wait execution-id --until success --timeout 10m --json

Wait for a workflow wait point

bash
$ tailor workflow wait execution-id --until suspended --timeout 6m --logs --json

Wait for success, failure, or suspension

bash
$ tailor workflow wait execution-id --until terminal

Shell automation

Capture the execution ID from workflow start and wait for the same run from a separate command:

bash
execution_id="$(
  tailor workflow start order-workflow --json | jq -r '.executionId'
)"

tailor workflow wait "$execution_id" \
  --until success \
  --timeout 10m \
  --interval 5s \
  --json

Wait until a workflow reaches a wait point, such as an approval step:

bash
tailor workflow wait "$execution_id" \
  --until suspended \
  --timeout 6m \
  --logs \
  --json

Programmatic API

Use waitWorkflowExecution when a script already has an execution ID and needs the same waiter behavior as the CLI:

ts
import { waitWorkflowExecution } from "@tailor-platform/sdk/cli";

const executionId = process.env.EXECUTION_ID;

if (!executionId) {
  throw new Error("EXECUTION_ID is required");
}

const result = await waitWorkflowExecution({
  executionId,
  until: "success",
  timeout: 10 * 60 * 1000,
  interval: 5000,
});

if (result.timedOut) {
  throw new Error(`Workflow ${result.id} timed out at ${result.status}`);
}

workflow executions ​

List or get workflow executions.

Usage

tailor workflow executions [options] [execution-id]

Arguments

ArgumentDescriptionRequired
execution-idExecution ID (if provided, shows details)No

Options

OptionAliasDescriptionRequiredDefaultEnv
--workspace-id <WORKSPACE_ID>-wWorkspace IDNo-TAILOR_PLATFORM_WORKSPACE_ID
--profile <PROFILE>-pWorkspace profileNo-TAILOR_PLATFORM_PROFILE
--order <ORDER>-Sort order (asc or desc)No"desc"-
--limit <LIMIT>-lMaximum number of items to return (0: unlimited)No50-
--workflow-name <WORKFLOW_NAME>-nFilter by workflow name (list mode only)No--
--status <STATUS>-sFilter by status (list mode only)No--
--wait-WWait for execution to completeNofalse-
--interval <INTERVAL>-iPolling interval when waiting (e.g., '3s', '500ms', '1m')No"3s"-
--timeout <TIMEOUT>-tMaximum time to wait (e.g., '30s', '10m')No"10m"-
--until <UNTIL>-uWait target (success, suspended, terminal)No"terminal"-
--logs-Display job execution logs (detail mode only)Nofalse-

See Global Options for options available to all commands.

Usage Examples:

bash
# List all executions
tailor workflow executions

# Filter by workflow name
tailor workflow executions -n my-workflow

# Filter by status
tailor workflow executions -s RUNNING

# Get execution details
tailor workflow executions <execution-id>

# Get execution details with logs
tailor workflow executions <execution-id> --logs

# Wait for execution to complete
tailor workflow executions <execution-id> -W

Without -n, the list covers every workflow in the workspace. Executions of different workflows are interleaved by start time, or by finish time for one that finished without starting, while each workflow's executions keep their creation order. An execution that has neither started nor finished counts as newer than every started or finished one. In a workspace with many workflows this takes longer; pass -n to list one workflow's executions.

workflow resume ​

Resume a failed or pending workflow execution.

Usage

tailor workflow resume [options] <execution-id>

Arguments

ArgumentDescriptionRequired
execution-idFailed execution IDYes

Options

OptionAliasDescriptionRequiredDefaultEnv
--workspace-id <WORKSPACE_ID>-wWorkspace IDNo-TAILOR_PLATFORM_WORKSPACE_ID
--profile <PROFILE>-pWorkspace profileNo-TAILOR_PLATFORM_PROFILE
--wait-WWait for execution to completeNofalse-
--interval <INTERVAL>-iPolling interval when waiting (e.g., '3s', '500ms', '1m')No"3s"-
--timeout <TIMEOUT>-tMaximum time to wait (e.g., '30s', '10m')No"10m"-
--until <UNTIL>-uWait target (success, suspended, terminal)No"terminal"-
--logs-lDisplay job execution logs after completionNofalse-

See Global Options for options available to all commands.