Pull (export) existing platform workflows to local .workflow.yaml definition files for version control, local editing, or transfer to another instance.
# Pull by workflow UUID
workflow pull abc123-def456-7890-abcd-ef1234567890
# Pull to a specific output file
workflow pull abc123-def456-... -o invoices.workflow.yaml
# Pull by workflow name (fuzzy match)
workflow pull "Invoice Processing"
workflow pull "Invoice"| Option | Short | Description |
|---|---|---|
IDENTIFIER |
Workflow UUID or name to pull | |
--output |
-o |
Output file path. Defaults to <slugified-name>.workflow.yaml |
The pull command follows a multi-stage workflow:
- Resolve Identifier — Determines if input is a UUID or name, resolves to workflow ID
- Fetch Workflow Data — Gets workflow, nodes, edges, and metadata via API
- Reverse-Resolve Dependencies — Converts server-side UUIDs to human-readable names:
agent_id→agent_name(via API lookup)knowledge_base_id→knowledge_base_name(via API lookup)
- Convert to WDF — Transforms API response to
.workflow.yamlformat:- Generates readable node slugs from
function_name(fallback:config_type) - Handles slug collisions with
_2,_3suffixes - Maps entry/exit UUIDs to slugs
- Strips visual-only data (positions, edge paths)
- Generates readable node slugs from
- Write
.workflow.yaml— Serializes WDF to YAML - Write
.workflow.lock— Saves lockfile with slug-to-UUID mappings
Node slugs in the YAML file are generated from server-side data:
| Priority | Source | Example |
|---|---|---|
| 1st | function_name (if set) |
invoice_agent |
| 2nd | config_type (fallback) |
llm-call |
Slug rules:
- Derived from
function_name: lowercased, underscores preserved (for backend variable reference compatibility) - Derived from
config_type(fallback): lowercased, underscores converted to hyphens - Collisions resolved with numeric suffixes:
agent,agent_2,agent_3
When pulling by name instead of UUID:
workflow pull "Invoice Processing Pipeline"
# Finds exact match, pulls immediatelyworkflow pull "Invoice"
# If only one workflow contains "Invoice" in its name, pulls itworkflow pull "Invoice"
# Multiple workflows match "Invoice":
# 1. Invoice Processing Pipeline (abc123...)
# 2. Invoice Approval Flow (def456...)
# Select a workflow: 1On the platform (stored as UUID):
{
"config": {
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"primaryInput": "{{<uuid>.output.text}}"
}
}After pull (in .workflow.yaml):
nodes:
my-agent:
type: agent
execution_mode: MESSAGES
config:
agent_name: Customer Support Agent
primaryInput: "{{user_input.output.text}}"On the platform (stored as UUID):
{
"config": {
"knowledge_base_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"topK": 5
}
}After pull (in .workflow.yaml):
nodes:
retrieval:
type: retrieve
execution_mode: FLOW
config:
knowledge_base_name: Company Policies
topK: 5If a UUID cannot be resolved (e.g., agent was deleted), it remains as-is in the config.
The pull command writes a .workflow.lock file alongside the YAML, enabling subsequent push operations to update instead of create:
# Auto-generated by workflow CLI. Do not edit manually.
workflow_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
organization_id: 11111111-2222-3333-4444-555555555555
version: 1
instance: https://api.sb.allogy.com
nodes:
user-input: 22222222-3333-4444-5555-666666666666
invoice-agent: 33333333-4444-5555-6666-777777777777
result: 44444444-5555-6666-7777-888888888888
edges:
user-input->invoice-agent: 10001
invoice-agent->result: 10002
pushed_at: '2026-02-18T14:30:00+00:00'This means workflow pull + workflow push forms a round-trip: pull a workflow, modify it locally, push it back to update in place.
The pull command requires CLI configuration (same as other commands):
Environment variables:
export WORKFLOW_API_HOST=https://api.sb.allogy.com
export WORKFLOW_API_KEY=your-api-key
export WORKFLOW_ORG_ID=your-org-uuid
# Optional: user JWT sent as a Bearer token for endpoints that reject API-key auth.
export WORKFLOW_JWT=your-jwt-access-tokenOr CLI flags:
workflow pull abc123 \
--host https://api.sb.allogy.com \
--api-key your-api-key \
--org your-org-uuidSee README.md for full configuration details.
workflow pull a1b2c3d4-e5f6-7890-abcd-ef1234567890
# Output:
# Pulling workflow: a1b2c3d4-e5f6-7890-abcd-ef1234567890
# Fetching workflow data... ✓ (5 nodes, 4 edges)
# Resolving dependencies... ✓ (1 resolved)
# Converting to WDF... ✓
# Writing invoice-processing-pipeline.workflow.yaml... ✓
# Writing lockfile... ✓ invoice-processing-pipeline.workflow.lock
# Pulled workflow: invoice-processing-pipeline.workflow.yamlworkflow pull a1b2c3d4-... -o workflows/invoices.workflow.yaml
# Output:
# ...
# Writing invoices.workflow.yaml... ✓
# Writing lockfile... ✓ invoices.workflow.lock
# Pulled workflow: workflows/invoices.workflow.yamlworkflow pull "Invoice Processing"
# Output:
# Searching for workflow: "Invoice Processing"
# Found workflow: a1b2c3d4-...
# Fetching workflow data... ✓ (5 nodes, 4 edges)
# ...# 1. Pull workflow from staging
workflow pull "Customer Support" -o support.workflow.yaml \
--host https://stage.sb.allogy.com
# 2. Edit locally
vim support.workflow.yaml
# 3. Validate changes
workflow validate support.workflow.yaml
# 4. Push back to staging
workflow push support.workflow.yaml
# Or push to production
workflow push support.workflow.yaml --host https://api.sb.allogy.comworkflow pull 00000000-0000-0000-0000-000000000000
# Output:
# Error: Failed to fetch workflow data: 404 Not Foundworkflow pull "Nonexistent Workflow"
# Output:
# Searching for workflow: "Nonexistent Workflow"
# Error: No workflow found matching "Nonexistent Workflow"workflow pull abc123
# Output:
# Error: Missing required configuration: host# Pull from internal instance
workflow pull "Invoice Processing" -o licensed-workflow.workflow.yaml
# Validate the export
workflow validate licensed-workflow.workflow.yaml
# Deliver to customer instance
workflow push licensed-workflow.workflow.yaml \
--host https://customer.api.example.com \
--api-key customer-api-key \
--org customer-org-uuid#!/bin/bash
# backup-workflows.sh
mkdir -p backups
# List all workflows, pull each one
workflow list --format json | jq -r '.[].id' | while read id; do
echo "Pulling $id..."
workflow pull "$id" -o "backups/$id.workflow.yaml"
done
echo "Backup complete!"- Jira Ticket: RAG-952 (Pull Command)
- Related Commands:
workflow push,workflow validate,workflow list - Dependencies: RAG-946 (API Client), RAG-945 (WDF Schema), RAG-949 (Lockfile)
- API Endpoints:
GET /v1/workflows/{id},GET /v1/workflow-nodes/,GET /v1/workflow-edges/,GET /v1/workflow-metadata/{id} - WDF Schema: See
docs/validate-command.mdfor node types