Workflows
Automate multi-step tasks by composing CLI commands and shell scripts in declarative JSON workflows.Workflows let you define reusable, multi-step automation sequences in a declarative JSON file. Think of workflows as lightweight CI/CD pipelines for App Store Connect tasks.
Quick Start
Create a workflow file at.asc/workflow.json:
Workflow File Structure
Workflows are defined in.asc/workflow.json (or a custom path with --file).
Top-Level Schema
Workflow Schema
Step Schema
Steps can be short form (bare string) or long form (object):Environment Variables
Workflows support environment variable expansion using$VAR or ${VAR} syntax:
Variable Precedence
- Runtime parameters (highest priority):
asc workflow run example VAR:value - Step-level
with:{"with": {"VAR": "value"}} - Workflow-level
env:{"env": {"VAR": "value"}} - Global
env: Top-levelenvobject - Process environment (lowest priority): Inherited from shell
Runtime Parameters
Pass parameters when running a workflow:KEY:VALUE. They override all other variable sources.
Conditional Steps
Use theif field to skip steps when a variable is unset or empty:
Calling Other Workflows
Workflows can call other workflows using theworkflow field:
preflight workflow is called first, with access to the NOTE variable.
Private workflows (
"private": true) are hidden from asc workflow list but can be called by other workflows.Hooks
Workflows support lifecycle hooks at the definition level:before_all
Runs once before any workflow:after_all
Runs once after the workflow completes (success or failure):error
Runs only on workflow failure:Output Format
Workflow output is JSON-only on stdout:Commands
workflow run
Run a named workflow:--file- Path to workflow.json (default:.asc/workflow.json)--dry-run- Preview steps without executing--pretty- Pretty-print JSON output
workflow list
List available workflows:--file- Path to workflow.json--all- Include private workflows--pretty- Pretty-print JSON output
workflow validate
Validate workflow file for errors and cycles:--file- Path to workflow.json--pretty- Pretty-print JSON output
Security Considerations
Best Practices
- Review workflow files before running them, especially with
--file - Avoid running workflows from untrusted sources (e.g., unreviewed PRs)
- Be careful with secrets - steps inherit your process environment
- In CI, use secret masking - workflows may log environment variables
- Use
workflow validateto check structure, but validation does not check safety
CI/CD Considerations
Avoid running workflows on untrusted pull requests with access to secrets or tokens.
Examples
TestFlight Distribution
App Store Submission
Related
- Error Handling - How workflows handle step failures
- Output Formats - Workflow output is JSON-only
- Authentication - Workflows inherit authentication