type: job for deterministic automation with optional AI-powered steps.
Quick Start
1
Simple Usage
deploy.yaml
2
With Configuration
3
Run programmatically
Async
[!TIP]
A YAML file is a job workflow when it has type: job at the root. Without it, PraisonAI treats it as an agent workflow.
No extra flag needed — the wrapper detects type: job and routes automatically. Previously only the praisonai workflow run CLI did this; the programmatic API now matches.
How It Works
Step Types
Deterministic Steps (No LLM)
Agent-Centric Steps (LLM-Powered)
Deterministic Steps
Shell Steps
subprocess.run() with shell=True. Non-zero exit code means failure.
Python Script Steps
sys.executable to match the current Python interpreter.
Inline Python Steps
exec() in a restricted namespace with safe builtins only.
What’s available in script:
Safe builtins only: Basic data types (int, str, list, dict), functions (len, range, min, max, print), etc.
No module imports: Standard library modules are not available in the namespace. Use vars or flags to pass data.
Error types you may see:
NameError: name 'module' is not defined— Module not available in namespaceSyntaxError: ...— Invalid Python syntaxException: ...— Runtime execution error
Action Steps
bump-version — bumps version = "X.Y.Z" in a file.
Agent-Centric Steps
Agent Step (agent:)
Execute an AI agent inline using praisonaiagents.Agent:
Features:
output_file:— automatically saves agent output to a filepromptsupports variable resolution:${{ env.X }},{{ flags.X }}- Tools are resolved from the
praisonaiagents.toolsregistry - Simple string shorthand:
agent: "Write a greeting"(uses defaults)
Judge Step (judge:)
Quality gate that evaluates content and passes/fails based on a threshold:
on_fail options:
Approve Step (approve:)
Human or automatic approval gate:
When
auto_approve: false, the workflow pauses and prompts in the console. Use flag expressions for dynamic control:
YAML-Defined Actions
Define reusable actions inline — including agent-powered actions:run: (shell), script: (inline Python), python: (script file), and agent: (AI agent).
Variables
Workflow Variables
Environment Variables
Variable Resolution
[!NOTE] Flag names with hyphens are converted to underscores:--no-bump→flags.no_bump.
Flags
Conditional Steps
flags (dot access) and env (os.environ) in scope.
Dry Run
Execution Output
Error Handling
Full Example
release.yaml
Comparison: Job vs Agent Workflows
YAML Schema Reference
Best Practices
Dry-run before deploy
Dry-run before deploy
Run
praisonai workflow run file.yaml --dry-run to validate step order and agent references before executing shell or publish steps.Use flags for CI vs production
Use flags for CI vs production
Define
flags: in YAML and reference them with if: expressions so one pipeline works locally and in CI without duplicating files.Keep agent steps optional
Keep agent steps optional
Structure workflows with deterministic steps first — build, test, publish — and add
agent: / judge: steps only where AI adds value.Set continue_on_error for cleanup
Set continue_on_error for cleanup
Use
continue_on_error: true on optional cleanup steps so a failed lint does not block teardown.Related
Custom Actions
YAML-defined, file-based, built-in actions
Hybrid Workflows
Combine job + multi-agent workflows
All Systems
Compare all 8 PraisonAI systems

