Muapi workflow

Build, run, and visualize multi-step AI generation workflows.

How to use it

  1. Hit Copy SKILL.md — or use the Claude Code line below to get every file.
  2. Claude: ⋯ → Download .md, then Customize → Skills → Add → Upload skill.
    ChatGPT: make a Project and paste it into Instructions.
    Neither? Paste it at the top of a new chat — it works for that chat.
  3. Describe your job in plain words. The AI follows the skill from there.
Claude Code — installs the whole folder, not just SKILL.md
npx degit SamurAIGPT/Generative-Media-Skills/library/workflow#main ~/.claude/skills/workflow

For one project only, change the path to .claude/skills/workflow. This skill also uses generate-workflow.sh, discover-workflow.sh, interactive-run.sh, run-workflow.sh — copying SKILL.md alone won't be enough. See the folder on GitHub.

Not working?
  • Check which app you pasted it into — the steps above name the right one.
  • Some skills need the paid tier of Claude or ChatGPT.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Show the full text197 lines
workflow/SKILL.md197 lines6.5 KBpushed 193d agoRawView on GitHub

AI Workflow Builder

Chain any combination of muapi.ai generation steps into automated pipelines. The AI architect converts your plain-language description into a runnable node graph.

Prerequisites

Always ensure the muapi CLI is up-to-date before running any commands. Reinstall from source at the start of every session:

pip install --upgrade /path/to/muapi-cli

Replace /path/to/muapi-cli with the actual path to the muapi-cli directory in the workspace (the directory containing pyproject.toml).

Core Operations

  1. Generate (generate-workflow.sh) — AI architect creates a workflow from a description
  2. Discover (discover-workflow.sh) — Find a relevant existing workflow by natural language
  3. Edit (generate-workflow.sh --workflow-id) — Modify an existing workflow with a prompt
  4. Interactive Run (interactive-run.sh) — Prompt for inputs and execute a workflow
  5. Run (run-workflow.sh) — Execute a workflow, poll node-by-node, collect outputs
  6. CLI (muapi workflow) — Full CRUD + visualization directly from the terminal

Agent Guided Discovery & Selection

As an AI agent, you have the ability to read and understand the purpose of available workflows to select the best one for the user's task (e.g., "create a UGC video").

  1. Discover: Fetch the catalog of available workflows and their descriptions in JSON format.
    muapi workflow discover --output-json
    
  2. Match (Internal Reasoning): Use your LLM capabilities to analyze the name, category, and description fields of the returned workflows. Find the best match for the user's intent.
  3. Analyze: If you find a promising candidate, inspect its structure to ensure it has the necessary nodes and parameters.
    muapi workflow get <workflow_id>
    
    CRITICAL RULE: The output of muapi workflow get will include an "API Inputs" table. You MUST read this table to understand what inputs are required.
  4. Choose & Confirm & Prompt User:
    • If one workflow is a perfect match, you MUST ask the user to provide the exact values for the required API inputs before executing it. Never invent or guess input values (like prompts, URLs, etc.) on your own.
    • If multiple workflows are highly relevant, present the options to the user with their descriptions and ask them to confirm which one to use, and also ask for the required inputs.
    • If no workflow matches the user's complex request, offer to architect a new one using muapi workflow create.

Example Agent Reasoning

"The user wants a product promo video. I fetched the catalog using discover. I see two potential workflows:

  1. wf_123: 'Product promo with background music'
  2. wf_456: 'Simple video gen' I will analyze wf_123 with get. It has the required nodes. I will suggest wf_123 or just run it if the match is precise."

Protocol: Building a Workflow

Step 1 — Describe your pipeline

muapi workflow create "take a text prompt, generate an image with flux-dev, then upscale it to 4K"

The architect returns a workflow with a unique ID and a node graph. Save the ID.

Step 2 — Inspect and visualize

# Rich ASCII node graph in the terminal
muapi workflow get <workflow_id>

# Or raw JSON
muapi workflow get <workflow_id> --output-json

Step 3 — Run it

# Run with specific inputs
muapi workflow execute <workflow_id> \
  --input "node1.prompt=a glowing crystal cave at midnight"

# Use --download to pull results locally
muapi workflow execute <workflow_id> \
  --input "node1.prompt=a sunset" \
  --download ./outputs

Step 4 — Discovery (Optional)

If you want to reuse an existing workflow instead of creating a new one:

# Search by keywords
muapi workflow discover "ugc video"

Step 5 — Interactive Execution

Run a workflow and have the CLI prompt you for each required input:

muapi workflow run-interactive <workflow_id>

Workflow Examples

Image Pipelines

# Text → Image → Upscale
muapi workflow create "take a text prompt, generate with flux-dev, upscale the result"

# Text → Image → Background removal → Product shot
muapi workflow create "generate a product image with hidream, remove background, create professional product shot"

Video Pipelines

# Text → Video
muapi workflow create "generate a 10-second cinematic video from a text prompt using kling-master"

# Image → Video → Lipsync
muapi workflow create "animate an input image with seedance, then apply lipsync from an audio file"

Editing an Existing Workflow

# Add a step
muapi workflow edit <id> --prompt "add a face-swap step after the image generation"

# Swap a model
muapi workflow edit <id> --prompt "change the video model from kling to veo3"

CLI Reference

# List all your workflows
muapi workflow list

# Browse templates
muapi workflow templates

# Generate new workflow
muapi workflow create "text → flux image → upscale → face swap"

# Visualize a workflow
muapi workflow get <id>

# Execute with inputs
muapi workflow execute <id> --input "node1.prompt=a sunset"

# Monitor a run
muapi workflow status <run_id>

# Get outputs
muapi workflow outputs <run_id> --download ./results

# Edit with AI
muapi workflow edit <id> --prompt "add lipsync at the end"

# Rename / delete
muapi workflow rename <id> --name "Product Pipeline v2"
muapi workflow delete <id>

MCP Tools (for AI agents)

Tool Description
muapi_workflow_list List user's workflows
muapi_workflow_create AI architect: prompt → workflow
muapi_workflow_get Get workflow definition + node graph
muapi_workflow_execute Run with specific inputs
muapi_workflow_status Node-by-node run status
muapi_workflow_outputs Final output URLs

Constraints

  • Workflows can contain any combination of muapi.ai nodes (image, video, audio, enhance, edit)
  • Node outputs are automatically wired as inputs to downstream nodes
  • --sync mode waits up to 120s for generation; use --async for complex workflows and poll separately
  • Run timeouts: 10 minutes maximum per workflow execution
1---
2name: muapi-workflow
3version: 0.1.0
4description: Build, run, and visualize multi-step AI generation workflows. The AI architect translates natural language descriptions into connected node graphs — chain image generation, video creation, enhancement, and editing into automated pipelines.
5---
6 
7# AI Workflow Builder
8 
9Chain any combination of muapi.ai generation steps into automated pipelines. The AI architect converts your plain-language description into a runnable node graph.
10 
11## Prerequisites
12 
13Always ensure the `muapi` CLI is up-to-date before running any commands. Reinstall from source at the start of every session:
14 
15```bash
16pip install --upgrade /path/to/muapi-cli
17```
18 
19Replace `/path/to/muapi-cli` with the actual path to the `muapi-cli` directory in the workspace (the directory containing `pyproject.toml`).
20 
21## Core Operations
22 
231. **Generate** (`generate-workflow.sh`) — AI architect creates a workflow from a description
242. **Discover** (`discover-workflow.sh`) — Find a relevant existing workflow by natural language
253. **Edit** (`generate-workflow.sh --workflow-id`) — Modify an existing workflow with a prompt
264. **Interactive Run** (`interactive-run.sh`) — Prompt for inputs and execute a workflow
275. **Run** (`run-workflow.sh`) — Execute a workflow, poll node-by-node, collect outputs
286. **CLI** (`muapi workflow`) — Full CRUD + visualization directly from the terminal
29 
30---
31 
32## Agent Guided Discovery & Selection
33 
34As an AI agent, you have the ability to read and understand the purpose of available workflows to select the best one for the user's task (e.g., "create a UGC video").
35 
361. **Discover**: Fetch the catalog of available workflows and their descriptions in JSON format.
37 ```bash
38 muapi workflow discover --output-json
39 ```
402. **Match (Internal Reasoning)**: Use your LLM capabilities to analyze the `name`, `category`, and `description` fields of the returned workflows. Find the best match for the user's intent.
413. **Analyze**: If you find a promising candidate, inspect its structure to ensure it has the necessary nodes and parameters.
42 ```bash
43 muapi workflow get <workflow_id>
44 ```
45 **CRITICAL RULE**: The output of `muapi workflow get` will include an "API Inputs" table. You MUST read this table to understand what inputs are required.
464. **Choose & Confirm & Prompt User**:
47 - If one workflow is a perfect match, you MUST ask the user to provide the exact values for the required API inputs before executing it. **Never invent or guess input values (like prompts, URLs, etc.) on your own.**
48 - If multiple workflows are highly relevant, present the options to the user with their descriptions and ask them to confirm which one to use, and also ask for the required inputs.
49 - If no workflow matches the user's complex request, offer to **architect** a new one using `muapi workflow create`.
50 
51### Example Agent Reasoning
52> "The user wants a product promo video. I fetched the catalog using `discover`. I see two potential workflows:
53> 1. `wf_123`: 'Product promo with background music'
54> 2. `wf_456`: 'Simple video gen'
55> I will analyze `wf_123` with `get`. It has the required nodes. I will suggest `wf_123` or just run it if the match is precise."
56 
57---
58 
59## Protocol: Building a Workflow
60 
61### Step 1 — Describe your pipeline
62 
63```bash
64muapi workflow create "take a text prompt, generate an image with flux-dev, then upscale it to 4K"
65```
66 
67The architect returns a workflow with a unique ID and a node graph. Save the ID.
68 
69### Step 2 — Inspect and visualize
70 
71```bash
72# Rich ASCII node graph in the terminal
73muapi workflow get <workflow_id>
74 
75# Or raw JSON
76muapi workflow get <workflow_id> --output-json
77```
78 
79### Step 3 — Run it
80 
81```bash
82# Run with specific inputs
83muapi workflow execute <workflow_id> \
84 --input "node1.prompt=a glowing crystal cave at midnight"
85 
86# Use --download to pull results locally
87muapi workflow execute <workflow_id> \
88 --input "node1.prompt=a sunset" \
89 --download ./outputs
90```
91 
92### Step 4 — Discovery (Optional)
93If you want to reuse an existing workflow instead of creating a new one:
94 
95```bash
96# Search by keywords
97muapi workflow discover "ugc video"
98```
99 
100### Step 5 — Interactive Execution
101Run a workflow and have the CLI prompt you for each required input:
102 
103```bash
104muapi workflow run-interactive <workflow_id>
105```
106 
107---
108 
109## Workflow Examples
110 
111### Image Pipelines
112 
113```bash
114# Text → Image → Upscale
115muapi workflow create "take a text prompt, generate with flux-dev, upscale the result"
116 
117# Text → Image → Background removal → Product shot
118muapi workflow create "generate a product image with hidream, remove background, create professional product shot"
119```
120 
121### Video Pipelines
122 
123```bash
124# Text → Video
125muapi workflow create "generate a 10-second cinematic video from a text prompt using kling-master"
126 
127# Image → Video → Lipsync
128muapi workflow create "animate an input image with seedance, then apply lipsync from an audio file"
129```
130 
131---
132 
133## Editing an Existing Workflow
134 
135```bash
136# Add a step
137muapi workflow edit <id> --prompt "add a face-swap step after the image generation"
138 
139# Swap a model
140muapi workflow edit <id> --prompt "change the video model from kling to veo3"
141```
142 
143---
144 
145## CLI Reference
146 
147```bash
148# List all your workflows
149muapi workflow list
150 
151# Browse templates
152muapi workflow templates
153 
154# Generate new workflow
155muapi workflow create "text → flux image → upscale → face swap"
156 
157# Visualize a workflow
158muapi workflow get <id>
159 
160# Execute with inputs
161muapi workflow execute <id> --input "node1.prompt=a sunset"
162 
163# Monitor a run
164muapi workflow status <run_id>
165 
166# Get outputs
167muapi workflow outputs <run_id> --download ./results
168 
169# Edit with AI
170muapi workflow edit <id> --prompt "add lipsync at the end"
171 
172# Rename / delete
173muapi workflow rename <id> --name "Product Pipeline v2"
174muapi workflow delete <id>
175```
176 
177---
178 
179## MCP Tools (for AI agents)
180 
181| Tool | Description |
182|------|-------------|
183| `muapi_workflow_list` | List user's workflows |
184| `muapi_workflow_create` | AI architect: prompt → workflow |
185| `muapi_workflow_get` | Get workflow definition + node graph |
186| `muapi_workflow_execute` | Run with specific inputs |
187| `muapi_workflow_status` | Node-by-node run status |
188| `muapi_workflow_outputs` | Final output URLs |
189 
190---
191 
192## Constraints
193 
194- Workflows can contain any combination of muapi.ai nodes (image, video, audio, enhance, edit)
195- Node outputs are automatically wired as inputs to downstream nodes
196- `--sync` mode waits up to 120s for generation; use `--async` for complex workflows and poll separately
197- Run timeouts: 10 minutes maximum per workflow execution

Discussion

Alternatives

Also in Workflow automation