Workflows
Code-orchestrated workflow pipelines — define multi-step automations where code handles control flow and the LLM handles judgment.
@elyracode/workflows introduces deterministic, reproducible workflow pipelines to Elyra. Traditional agent orchestration uses an LLM to plan, spawn sub-agents, and decide next steps — every result re-enters the orchestrator's context window, paying a "token tax" that degrades quality as the window fills.
Workflows flip this model: code orchestrates, the LLM only judges. Each step is focused, deterministic, and reproducible.
Install
elyra install npm:@elyracode/workflows
The extension activates automatically when the project contains a .elyra/workflows/ directory.
Usage
Create workflow files in .elyra/workflows/:
{
"name": "deploy",
"description": "Build, test, review, deploy",
"steps": [
{ "name": "test", "run": "npm test" },
{ "name": "review", "prompt": "Review the test output:\n{{steps.test.output}}" },
{ "name": "deploy", "run": "npm run deploy", "if": "{{steps.test.code}} == 0" }
]
}
Run with /workflow deploy or just ask the agent to run it.
Commands
| Command | Description |
|---|---|
/workflow |
List available workflows in .elyra/workflows/ |
/workflow <name> |
Execute a workflow by name |
Step types
| Type | Description |
|---|---|
prompt |
Send a focused prompt to the LLM. Output is captured and made available to subsequent steps. |
run |
Execute a shell command. Captures stdout, stderr, and exit code. |
if |
Conditional execution based on previous step results. |
parallel |
Run multiple steps concurrently and merge their outputs. |
Template variables
Reference previous step outputs anywhere in a step definition:
{{steps.<name>.output}}— stdout (or LLM response forpromptsteps){{steps.<name>.code}}— exit code (forrunsteps){{steps.<name>.stderr}}— stderr (forrunsteps)
Examples
> Create a workflow that runs tests, then asks the LLM to summarize failures
> Run the deploy workflow
> List available workflows
Why code orchestration?
When an LLM plans and dispatches sub-agents, every result flows back through its context window. As you chain steps, the context fills with stale outputs, prior decisions, and reasoning artifacts that degrade subsequent judgments.
A workflow runs deterministically: step 1's output is piped into step 2's prompt as plain template data, never polluting an orchestrator's context. The LLM is only invoked when judgment is needed — review, summarize, decide — not for routing.
Included skill
The elyra-workflows skill teaches the agent:
- Workflow file format and step types
- When to choose workflows over
/swarmor manual orchestration - Template interpolation patterns
- Conditional and parallel execution idioms