workflow start

The workflow start command starts a run of a deployed durable workflow. The payload is the run's input as JSON. The run starts in the background; the command prints its ID and status.

Usage

stacktape workflow start <workflow> --stage <stage> --region <region> --payload '<json>'

Give the run an ID with --run-id when the same work must not run twice, for example onboarding-<userId>. Starting the same ID with the same payload again returns the existing run and starts nothing new (outcome: "existing" and started: false in JSON output). The same ID with a different payload is refused. Payloads are compared as JSON: whitespace and key order do not matter, and numbers compare by their exact digits (1 and 1.0 differ). When two starts of one ID run at the same moment, only the one that created the run reports outcome: "started". In the rare case the CLI can't tell, it reports outcome: "started-or-existing"; there is still one run. AWS keeps the ID of a finished run until its history retention ends, so to run the same work again later, use workflow rerun.

With --wait, the command waits up to 15 minutes for the run to finish and prints its output. It fails when the run fails, and stops with WORKFLOW_RUN_PAUSED when the run pauses; a paused run has not failed and can be resumed with workflow resume.

On a production stage the command asks for confirmation; --yes confirms it. In agent mode --yes is required.

Flags reference

stacktape workflow start <resource-name>CLI options
-r, --regionrequired"us-east-2" | "us-east-1" | "us-west-1" | "us-west-2" | "ap-east-1" | "ap-south-1" | "ap-northeast-3" | "ap-northeast-2" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ca-central-1" | "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "me-south-1" | "sa-east-1" | "af-south-1" | "eu-south-1"

AWS Region

The AWS region for the operation. For a list of available regions, see the AWS documentation.

For commands such as deploy, this flag overrides the project's configured region. If you omit it, Stacktape checks the project's config, AWS_DEFAULT_REGION, the default saved with defaults set, then the AWS profile.

--resource-name (positional 1)requiredstring

Resource Name

The name of the resource as defined in your Stacktape configuration.

-s, --stagerequiredstring

Stage

The stage for the operation (e.g., production, staging, dev-john). You can set a default stage using the defaults set command. Stage names use lowercase letters, numbers and dashes, with at least 2 characters. The project name, a dash and the stage form the CloudFormation stack name, which can have at most 128 characters. Stacktape shortens an AWS resource name that would be too long and adds a hash.

-y, --yesboolean

Auto-Confirm Operation

Confirms an operation that would otherwise ask first: deleting a stack, an update that may delete stateful resources, creating a project that does not exist yet, and the other deletions that ask. Without a terminal to ask in (CI, --agent, machine-readable output), such an operation fails with CONFIRMATION_REQUIRED unless this flag is set. --agent does not confirm anything.

--aws-accountstring

AWS Account

The name of the AWS account to use for the operation. The account must first be connected in the Stacktape Console.

Without it, the account is chosen by --profile, AWS_PROFILE or AWS credentials in environment variables, then by your saved default, then by your organization's only connected account. --aws-account takes precedence over all of them, but AWS credentials in environment variables must then belong to that account.

-c, --configstring

Config File Path

The path to your Stacktape configuration file, relative to the current working directory. Without it, Stacktape uses the one stacktape.ts, stacktape.yml, stacktape.yaml or stacktape.js in the working directory. When there are several, the command stops and asks you to choose one with this option.

--cwdstring

Current Working Directory

The working directory for the operation. All file paths in your configuration will be resolved relative to this directory. By default, this is the directory containing the configuration file.

-h, --helpstring

Show Help

If provided, the command will not execute and will instead print help information.

--log-level"info" | "debug" | "error"

Log Level

The level of logs to print to the console.

  • info: Basic information about the operation.
  • error: Only errors.
  • debug: Detailed information for debugging.
--payloadstring

Payload

The run's input as JSON, for example '{"userId":"u_1"}'. Defaults to {}.

--payload-filestring

Payload File

Path to a JSON file with the run's input. Use it instead of --payload for larger inputs.

-p, --profilestring

AWS Profile

The AWS profile to use for the command. You can manage profiles using the aws-profile:* commands and set a default profile with defaults set.

For commands that use a connected AWS account, --profile (or AWS_PROFILE) selects the connected account the profile belongs to, unless --aws-account is set. The command fails if that account is not connected.

--projectstring

Project Name

The name of the Stacktape project for this operation.

Commands that target a stack take it from projectName in the project's config when the flag is absent.

--quietboolean

Quiet

Hide progress, banners, success messages and hints. Command output, warnings and errors are still printed.

--run-idstring

Run ID

The ID of the new run: 1–64 letters, digits, - or _. Starting the same ID with the same payload again returns the existing run instead of starting a second one. AWS keeps the ID of a finished run until its history retention ends. Without it, a random ID is used.

--waitboolean

Wait

Waits up to 15 minutes for the run to finish and prints its output. Fails when the run fails, and stops with WORKFLOW_RUN_PAUSED when the run pauses (it can be resumed). A run that is still going after 15 minutes is left running.

Examples

stacktape workflow start onboarding --stage prod --region eu-west-1 --payload '{"userId":"u_1"}' --run-id onboarding-u_1
stacktape workflow start report --stage prod --region eu-west-1 --payload-file input.json --wait