Core Concepts
Specifying Inputs
Inputs are declared in theinputs array of a workflow. Each input has a key, a type, and an optional default.
Scalar inputs
Array inputs
There are two kinds of array inputs: Manual array — the caller provides a list of items directly:entityType can be resource, environment, or deployment. The default is a CEL expression used when the caller does not override the selector.
Input resolution
When a run is created, Ctrlplane merges the caller’s provided values with the workflow’s defaults:- Start with the values provided by the caller.
- For each input defined on the workflow, if no value was provided, apply the
default(if set). - The final merged map is stored on the
WorkflowRunrecord and passed to every dispatched job.
Wiring in Job Agents
ThejobAgents array defines which executors the workflow uses. Each entry has:
Selector evaluation
Before dispatching, Ctrlplane evaluates each agent’sselector against the dispatch context:
"true" to always dispatch to this agent, or write a CEL expression to make it conditional:
true receives its own job.
Templating Inputs into Job Agents
Bothconfig values and the selector field support Go text/template syntax. Templates are rendered before dispatch using the same dispatch context:
Example: GitHub Actions
{ "repo": "api-service", "branch": "main" }, the rendered config becomes:
Job record and passed to the job agent dispatcher. The agent then uses it to construct the actual dispatch call (e.g., the GitHub API workflow_dispatch event).
Conditional agent selection
environment is "production".
Full Example: Database Migration Workflow
This workflow runs a database migration via GitHub Actions, with a dry-run option and environment targeting.Workflow definition (API)
GitHub Actions workflow
The GitHub Actions workflow receives ajob_id from Ctrlplane. Use the ctrlplanedev/get-job-inputs action to fetch the resolved inputs:
Workflow inputs are surfaced on the job as
inputs_<key> outputs by get-job-inputs.Triggering a run (API)
dry_run were omitted, Ctrlplane would fall back to the default true.
Example: Multi-Agent Workflow (GitHub + Terraform Cloud)
A single workflow can dispatch to multiple agents simultaneously. Here, a restart workflow notifies Slack via GitHub Actions and triggers a Terraform Cloud run to scale down and back up:notify agent runs for every environment. The terraform-restart agent only runs when targeting production.
Terraform Provider
Use thectrlplane Terraform provider to manage workflows as code.
Create a workflow
Reference other resources
API Reference
Create workflow run request body
inputs is required. Omit keys to use their defaults; keys with no default and no provided value will be absent from the dispatch context.
How It Works Internally
- Input resolution — user-provided values are merged with defaults declared on the workflow.
- Selector evaluation — each agent’s
selectorCEL expression is evaluated against{ workflow, inputs }. Only agents whose selector returnstruereceive a job. - Job creation — a
Jobis inserted with the renderedjobAgentConfigand the fullDispatchContext(which includes the resolved inputs). - Job dispatch — the workspace engine picks up the job and calls the agent-specific dispatcher (GitHub, TFC, ArgoCD, etc.).
- Status tracking — agents report back via webhooks or the Ctrlplane API, updating job status in real time.
Next Steps
GitHub Actions
Wire up GitHub Actions as a job agent
Terraform Cloud
Trigger Terraform Cloud runs from workflows
ArgoCD
Sync ArgoCD applications on demand
Argo Workflows
Execute Argo Workflow templates