inspect Commands
agac inspect is the read-only command that shows the structure of a workflow. The
default form runs the preflight validation and lists the validated actions.
Two subcommands show the details of a single action.
agac inspect -w <workflow> # default: validation + action list
agac inspect action -w <workflow> ACTION [options]
agac inspect context -w <workflow> ACTION [options]
You can run inspect commands from any subdirectory in your project.
Options
| Option | Description |
|---|---|
-w, --workflow | The workflow name. Required. -a names the same option. Without it, agac inspect exits 2 with Missing required option '-w' / '--workflow'. Run 'agac inspect --help' for usage. |
--sandbox | Show the workflow as agac run --sandbox runs it. Each LLM action is sent to the mock provider, and inspect action marks it answered by the sandbox mock after its model. inspect action marks a tool action that the scenario stubs stubbed by the sandbox scenario. Give the option before the subcommand: agac inspect -w my_workflow --sandbox action summarize. See Sandbox Runs |
--scenario happy|chaos|PATH | With --sandbox: the scenario that a sandbox run follows, a preset or the path of a scenario file. Without this option, the command reads sandbox.<workflow>.yml at the project root, else sandbox.yml, else happy. A preset keeps the stub entries of that file, as in a run. A scenario that a run refuses stops the command. Without --sandbox, the option is an error. Give the option before the subcommand. See Stub a tool action |
-u, --user-code | The path to the user code directory. inspect action and inspect context also accept this option |
Default Behavior
agac inspect -w <workflow> runs the preflight validation and prints a
list of the validated actions. The list has one ✓ for each action, and one ● validated badge for
the whole workflow. The command exits 0 on success. It exits with a non-zero code on a validation error.
$ agac inspect -w review_analyzer
review_analyzer ● validated 5 actions
✓ fetch_reviews
✓ analyze_sentiment
✓ extract_topics
✓ generate_summary
✓ write_report
The preflight validation checks these items:
- Action definitions
- Dependency cycles
context_scopereferences. This check includes two conditions:- At least one
observeorpassthroughfield refers to each declared dependency. - Each action that a
context_scope, a prompt or a guard names is upstream of it throughdependencies.
- At least one
- Template variables
- Schema structure
- Each schema that an action names by file exists and loads. This check applies to LLM actions and tool actions.
- Guard syntax
- Each
action_name.fieldthat a prompt or a guard reads names an action in the workflow and a field that its schema lists.
If a static check fails, you get
a PreFlightValidationError that names the exact YAML field. You do not get
the list.
The command prints a finding that does not stop the run above the list, as a
warning. The command still exits 0. agac run prints the same
warnings before it starts. The command prints each finding one time, in a group with the other findings of the same
check:
Pre-flight: static analysis — 1 warning(s)
└─ assign_team: Action 'assign_team': seed field 'routing_rules' is both in
context_scope.observe and referenced in the prompt template ...
To see the structure, use inspect action <name> or inspect context <name>.
inspect action <name> shows the dependencies, the prompt, the schema and the actions that read this action.
inspect context <name> shows the template variables that are in scope.
Subcommands
| Subcommand | Description |
|---|---|
action | The detailed configuration of a single action |
context | A view of the template variables of a single action, for debugging |
Each subcommand accepts its own --json flag for output that a machine can read.
inspect action
agac inspect action -w <workflow> <action_name> [--json]
This subcommand shows these items for one action:
- The configuration
- The dependencies
- The context scope
- The prompt template, with no values in its field references
- The output schema
- The model and run settings
- The downstream actions that use the action
inspect context
agac inspect context -w <workflow> <action_name> [--json]
This subcommand shows the available namespaces, the applied context scope, and the template variables that the prompt of the action would see.
inspect action and inspect context show an optional observe field
with its ?, for example Reads note_direct: kind, summary?. With --json, the
context_scope.observe list holds note_direct.summary?. The output does not show the
default of the field.
If you get "undefined variable" errors in your templates, use
inspect context. It shows exactly which variables are available for that
action.
Exit Codes
| Code | Meaning |
|---|---|
| 0 | The inspection is OK (the validation passed, and the command showed the action list) |
| 1 | The validation failed, or a different CLI error occurred |
| 2 | Incorrect flags, or a missing required option |
Common Patterns
Debug Dependencies
The default agac inspect -w my_workflow validates the workflow and lists
its actions. To see the details of one action, with its inputs, context, schema and
prompt template, use inspect action:
agac inspect action -w my_workflow problematic_action
Validate Before a Run (in CI)
agac inspect -w my_workflow || exit 1
agac run -w my_workflow
Debug Template Variables
agac inspect context -w my_workflow problematic_action
agac inspect context -w my_workflow problematic_action --json | jq '.namespaces'
See Also
- schema Command: Analyze field dependencies and the shapes of data
- run Command: Run workflows
- Troubleshooting: Debug common problems