Skip to main content
The pflow workflow command group manages saved workflows in the global library (~/.pflow/workflows/).
Agent commands. These commands are primarily used by your AI agent to find and inspect workflows. The save command can be used by either you or your agent to persist workflows.

Commands

CommandDescription
listList all saved workflows
describeShow workflow interface details
historyShow execution history and last used inputs
discoverFind workflows using natural language
saveSave a workflow file to the library

pflow workflow list

List all saved workflows with optional filtering.
pflow workflow list [FILTER_PATTERN] [--json]
Arguments:
  • FILTER_PATTERN - Optional keywords to filter (space-separated, AND logic)
Options:
  • --json - Output as JSON
Examples:
# List all workflows
pflow workflow list

# Filter by keyword
pflow workflow list github

# Filter by multiple keywords (AND logic)
pflow workflow list "github pr"

# JSON output
pflow workflow list --json
Output: Workflows are grouped by category, showing name and description:
Saved workflows:

  github:
    - github-pr-review: Review pull requests and suggest improvements
    - github-issue-triage: Categorize and label GitHub issues

  analysis:
    - csv-analyzer: Analyze CSV files and generate reports

Total: 3 workflows

pflow workflow describe

Show detailed information about a workflow including inputs, outputs, and usage.
pflow workflow describe <NAME>
Arguments:
  • NAME - Workflow name (required)
Example:
pflow workflow describe github-pr-review
Output:
Workflow: github-pr-review

Description: Review pull requests and suggest improvements

Inputs:
  - repo (string, required): Repository in owner/repo format
  - pr_number (integer, required): Pull request number
  - focus (string, optional): Areas to focus review on

Outputs:
  - review: Structured review with suggestions
  - summary: Brief summary of findings

Example usage:
  pflow github-pr-review repo=owner/repo pr_number=123
If the workflow is not found, pflow suggests similar workflow names.

pflow workflow history

Show execution history and last used inputs for a workflow.
pflow workflow history <NAME>
Arguments:
  • NAME - Workflow name (required)
Example:
pflow workflow history release-announcements
Output:
Execution History: release-announcements

Runs: 10
Last run: 2026-02-04 23:44:38
Status: Success

Last used inputs:
  version: 0.5.0
  changelog_path: /Users/you/project/CHANGELOG.md
  slack_channel: releases
  discord_channel_id: 1234
This is useful for finding previously used input values like channel IDs, API endpoints, or other parameters that are often reused.
If the workflow has never been run, pflow shows “No execution history recorded.”

pflow workflow discover

Use AI to find workflows matching a natural language task description.
pflow workflow discover "<QUERY>"
Arguments:
  • QUERY - Natural language description of what you want to do (max 500 characters)
Example:
pflow workflow discover "I need to analyze pull requests"
Output: When a match is found:
Found matching workflow: github-pr-review

Match confidence: High
Reasoning: This workflow analyzes PR content and provides structured feedback.

Description: Review pull requests and suggest improvements

Inputs:
  - repo (string, required): Repository in owner/repo format
  - pr_number (integer, required): Pull request number

Example usage:
  pflow github-pr-review repo=owner/repo pr_number=123
When no match is found, pflow explains why and lists available workflows.
Requires an API key to be configured. See Quickstart for setup.

pflow workflow save

Save a workflow file to the global library for reuse.
pflow workflow save <FILE> --name <NAME> [OPTIONS]
Arguments:
  • FILE - Path to workflow file (.pflow.md)
Required options:
  • --name NAME - Workflow name (lowercase, numbers, hyphens only, max 30 chars)
Optional options:
  • --force - Overwrite existing workflow with same name
  • --delete-draft - Delete source file after successful save
Examples:
# Basic save
pflow workflow save ./workflow.pflow.md --name pr-analyzer

# Overwrite existing workflow
pflow workflow save ./updated.pflow.md --name pr-analyzer --force

# Save and delete draft file
pflow workflow save ./draft.pflow.md --name finalized-workflow --delete-draft
Name format requirements:
  • Lowercase letters, numbers, and hyphens only
  • Maximum 30 characters
  • Must be shell-safe and URL-safe
Output:
✓ Saved workflow: pr-analyzer

Location: ~/.pflow/workflows/pr-analyzer.pflow.md

Inputs:
  - repo (string, required)
  - pr_number (integer, required)

Example usage:
  pflow pr-analyzer repo=owner/repo pr_number=123

Workflow file format

Workflows are markdown files (.pflow.md) with a simple structure:
# My Workflow

Description of what this workflow does.

## Inputs

### input_name

What this input is for.

- type: string
- required: true

## Steps

### read-data

Read the input file.

- type: read-file
- file_path: ${input_name}

### summarize

Summarize the file contents using AI.

- type: llm
- prompt: Summarize this: ${read-data.content}

## Outputs

### result

Summary of the input file.

- source: ${summarize.response}
The workflow title (# My Workflow) is the display name. The programmatic name comes from the filename (my-workflow.pflow.mdmy-workflow). Step order determines execution order — no explicit edge declarations needed.

File locations

PathPurpose
~/.pflow/workflows/Saved workflows (global library)
.pflow/workflows/Draft workflows (project-local)