Workflows

Chain prompts, run directories, and reuse output

A workflow is one or more prompt steps.

Single step

promd weather

If you omit the extension, promptmd tries weather.md.

Chaining steps

Pass multiple step names as separate arguments:

promd weather plan-activities

Each step receives the previous output as {{input}}.

Combining files into one step

Pass comma-separated file paths as a single argument to merge them into one step. The prompts are concatenated and sent as a single request, and the output flows into the next step as {{input}} just like any other step.

promd file1,file2 file3

Here file1 and file2 are combined into a single step, then the result is chained into file3.

You can mix combined steps with regular steps in the same workflow:

promd context,instructions task final-report

Note: comma-separated paths only support files, not directories.

Run a directory

Pass a directory path (or .) to execute all .md files in that directory, sorted by filename:

promd .
promd ./my-workflow

Tip: prefix filenames with numbers if you want an explicit order, e.g. 01-fetch.md, 02-summarize.md.

Directory as a step

In a chain, a step can also be a directory. The next step receives the last prompt output produced by that directory.

promd ./my-workflow final-report

Looping

Use the loop subcommand to run a workflow multiple times, optionally stopping early when the output contains a string.

promd loop --count 10 --exitOn "Complete" ./my-workflow

On this page