Workflows let you run on-demand operations — restarts, migrations, backfills, data exports — across one or more job agents. Unlike deployments, workflows are not tied to versions or release targets; they accept typed inputs at runtime and fan out jobs to whichever agents match the conditions you specify.Documentation Index
Fetch the complete documentation index at: https://docs.ctrlplane.dev/llms.txt
Use this file to discover all available pages before exploring further.
Core Concepts
| Concept | Description |
|---|---|
| Workflow | A named template with input definitions and a list of job agents |
| Input | A typed parameter declared on the workflow (string, number, boolean, object, or array) |
| Job Agent | An executor (GitHub Actions, ArgoCD, Terraform Cloud, etc.) referenced by ID |
| Selector | A CEL expression evaluated against the dispatch context to decide whether the agent runs |
| Workflow Run | A single execution of a workflow with a specific set of input values |
| Workflow Job | A job dispatched to one agent during a run |
Specifying Inputs
Inputs are declared in theinputs array of a workflow. Each input has a key, a type, and an optional default.
Scalar inputs
| Type | JSON type | Notes |
|---|---|---|
string | string | |
number | number | Integer or float |
boolean | boolean | |
object | object | Arbitrary JSON object |
array | array | See below |
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:
| Field | Required | Description |
|---|---|---|
name | Yes | Display name for the agent within this workflow |
ref | Yes | The UUID of a registered job agent |
config | Yes | Agent-specific configuration (see Templates) |
selector | Yes | CEL expression — the agent only runs if this evaluates to true |
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:
| Variable | Description |
|---|---|
{{.inputs.<key>}} | Resolved input values |
{{.workflow}} | The workflow definition |
{{.jobAgentConfig}} | This agent’s rendered config (available in nested templates) |
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
| Method | Endpoint | Description |
|---|---|---|
GET | /v1/workspaces/{workspaceId}/workflows | List all workflows |
POST | /v1/workspaces/{workspaceId}/workflows | Create a workflow |
GET | /v1/workspaces/{workspaceId}/workflows/{workflowId} | Get a workflow |
PUT | /v1/workspaces/{workspaceId}/workflows/{workflowId} | Update a workflow |
DELETE | /v1/workspaces/{workspaceId}/workflows/{workflowId} | Delete a workflow |
POST | /v1/workspaces/{workspaceId}/workflows/{workflowId}/runs | Trigger a workflow run |
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