Workflow configuration
Define multi-step automation workflows in .asc/workflow.jsonWorkflows allow you to define multi-step automation sequences in a
.asc/workflow.json file. This is useful for complex release processes that involve multiple commands.
Workflow file structure
Create a.asc/workflow.json file in your project root:
Running workflows
Execute a workflow by name:When
--file is omitted, the CLI looks for .asc/workflow.json in the current directory.Workflow schema
Top-level fields
object
Global environment variables available to all workflows
string
Command to run before any workflow executesUseful for validation or setup tasks.
string
Command to run after a workflow completes successfullyUseful for cleanup or notifications.
string
Command to run if a workflow failsUseful for error notifications or rollback.
object
required
Map of workflow names to workflow definitions
Workflow fields
string
Human-readable description of the workflow
boolean
Hide this workflow from
asc workflow listDefault: falseobject
Workflow-specific environment variablesThese override global
env variables.array
required
List of steps to execute (see step format below)
Step formats
Steps can be defined in two formats: Short form (string):Step fields
string
Step name (displayed during execution)
string
Shell command to execute
string
Name of another workflow to run (sub-workflow)Mutually exclusive with
run.string
Condition expression (evaluated as shell command)Step runs only if the command exits with code 0.
object
Environment variables passed to the stepOnly applies to
workflow steps.Environment variable precedence
Environment variables are resolved in this order (highest to lowest):- Runtime parameters (
KEY:VALUEarguments toasc workflow run) - Step
withfield (for sub-workflows) - Workflow
envfield - Global
envfield - System environment variables
APP_ID defined in the workflow file.
Conditional steps
Use theif field to conditionally execute steps:
if condition is evaluated as a shell command. The step runs only if the command exits with code 0.
Sub-workflows
Call other workflows from within a workflow:Lifecycle hooks
Workflow hooks run at specific points during execution:before_all: Runs before any workflow startsafter_all: Runs after a workflow completes successfullyerror: Runs if any step fails
Complete example
Here’s a comprehensive workflow for a full release process:CI/CD integration
GitHub Actions
GitLab CI
Security considerations
Troubleshooting
Workflow not found
Environment variable not expanded
Ensure variables are defined in the workflow file or passed asKEY:VALUE arguments:
Step fails silently
Check exit codes and stderr:Related
Workflow command
Workflow command reference
Automation guide
Workflow automation patterns