muapi-workflow

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AI Workflow Builder

AI工作流构建器

Chain any combination of muapi.ai generation steps into automated pipelines. The AI architect converts your plain-language description into a runnable node graph.
将muapi.ai的任意生成步骤组合为自动化流水线。AI架构师可将你的自然语言描述转换为可运行的节点图。

Prerequisites

前置要求

Always ensure the
muapi
CLI is up-to-date before running any commands. Reinstall from source at the start of every session:
bash
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
).
在运行任何命令前,请确保
muapi
CLI是最新版本。每次会话开始时从源码重新安装:
bash
pip install --upgrade /path/to/muapi-cli
/path/to/muapi-cli
替换为工作区中
muapi-cli
目录的实际路径(包含
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

  1. 生成
    generate-workflow.sh
    )——AI架构师根据描述创建工作流
  2. 发现
    discover-workflow.sh
    )——通过自然语言查找相关的现有工作流
  3. 编辑
    generate-workflow.sh --workflow-id
    )——通过提示词修改现有工作流
  4. 交互式运行
    interactive-run.sh
    )——提示输入参数并执行工作流
  5. 运行
    run-workflow.sh
    )——执行工作流,逐节点轮询,收集输出结果
  6. CLI操作
    muapi workflow
    )——直接在终端完成完整的CRUD(创建、读取、更新、删除)及可视化操作

Agent Guided Discovery & Selection

Agent引导的发现与选择

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.
    bash
    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.
    bash
    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
      .
作为AI Agent,你能够读取并理解可用工作流的用途,从而为用户任务选择最合适的工作流(例如“创建UGC视频”)。
  1. 发现:获取可用工作流目录及其JSON格式的描述。
    bash
    muapi workflow discover --output-json
  2. 匹配(内部推理):利用你的LLM能力分析返回工作流的
    name
    category
    description
    字段,找到与用户意图最匹配的选项。
  3. 分析:如果找到合适的候选工作流,请检查其结构以确保包含必要的节点和参数。
    bash
    muapi workflow get <workflow_id>
    重要规则
    muapi workflow get
    的输出将包含一个“API输入”表格。你必须阅读此表格以了解所需的输入参数。
  4. 选择、确认并提示用户
    • 如果有一个工作流完全匹配,你必须要求用户提供所需API输入的准确值,然后再执行。切勿自行编造或猜测输入值(如提示词、URL等)。
    • 如果有多个高度相关的工作流,请向用户展示选项及其描述,让用户确认使用哪一个,并同时要求提供所需的输入参数。
    • 如果没有工作流匹配用户的复杂请求,提议使用
      muapi workflow create
      构建一个新的工作流。

Example Agent Reasoning

Agent推理示例

"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."

“用户想要一个产品宣传视频。我使用
discover
获取了目录。发现两个潜在工作流:
  1. wf_123
    :‘带背景音乐的产品宣传视频’
  2. wf_456
    :‘简单视频生成’ 我将用
    get
    分析
    wf_123
    ,它包含所需的节点。我会推荐
    wf_123
    ,如果匹配度足够高也可直接运行。"

Protocol: Building a Workflow

工作流构建流程

Step 1 — Describe your pipeline

步骤1 — 描述你的流水线

bash
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.
bash
muapi workflow create "接收文本提示词,使用flux-dev生成图像,然后将其放大至4K分辨率"
架构师会返回一个带有唯一ID和节点图的工作流,请保存该ID。

Step 2 — Inspect and visualize

步骤2 — 检查与可视化

bash
undefined
bash
undefined

Rich ASCII node graph in the terminal

在终端中显示富文本ASCII节点图

muapi workflow get <workflow_id>
muapi workflow get <workflow_id>

Or raw JSON

或导出为原始JSON格式

muapi workflow get <workflow_id> --output-json
undefined
muapi workflow get <workflow_id> --output-json
undefined

Step 3 — Run it

步骤3 — 运行工作流

bash
undefined
bash
undefined

Run with specific inputs

使用指定输入运行

muapi workflow execute <workflow_id>
--input "node1.prompt=a glowing crystal cave at midnight"
muapi workflow execute <workflow_id>
--input "node1.prompt=a glowing crystal cave at midnight"

Use --download to pull results locally

使用--download参数将结果下载到本地

muapi workflow execute <workflow_id>
--input "node1.prompt=a sunset"
--download ./outputs
undefined
muapi workflow execute <workflow_id>
--input "node1.prompt=a sunset"
--download ./outputs
undefined

Step 4 — Discovery (Optional)

步骤4 — 发现(可选)

If you want to reuse an existing workflow instead of creating a new one:
bash
undefined
如果你想复用现有工作流而非创建新的:
bash
undefined

Search by keywords

按关键词搜索

muapi workflow discover "ugc video"
undefined
muapi workflow discover "ugc video"
undefined

Step 5 — Interactive Execution

步骤5 — 交互式执行

Run a workflow and have the CLI prompt you for each required input:
bash
muapi workflow run-interactive <workflow_id>

运行工作流并通过CLI提示你输入每个必填参数:
bash
muapi workflow run-interactive <workflow_id>

Workflow Examples

工作流示例

Image Pipelines

图像流水线

bash
undefined
bash
undefined

Text → Image → Upscale

文本 → 图像 → 放大

muapi workflow create "take a text prompt, generate with flux-dev, upscale the result"
muapi workflow create "接收文本提示词,使用flux-dev生成图像,然后放大结果"

Text → Image → Background removal → Product shot

文本 → 图像 → 背景移除 → 产品图

muapi workflow create "generate a product image with hidream, remove background, create professional product shot"
undefined
muapi workflow create "使用hidream生成产品图像,移除背景,创建专业产品展示图"
undefined

Video Pipelines

视频流水线

bash
undefined
bash
undefined

Text → Video

文本 → 视频

muapi workflow create "generate a 10-second cinematic video from a text prompt using kling-master"
muapi workflow create "使用kling-master根据文本提示词生成10秒 cinematic视频"

Image → Video → Lipsync

图像 → 视频 → 唇形同步

muapi workflow create "animate an input image with seedance, then apply lipsync from an audio file"

---
muapi workflow create "使用seedance将输入图像动画化,然后对音频文件应用唇形同步"

---

Editing an Existing Workflow

编辑现有工作流

bash
undefined
bash
undefined

Add a step

添加步骤

muapi workflow edit <id> --prompt "add a face-swap step after the image generation"
muapi workflow edit <id> --prompt "在图像生成后添加换脸步骤"

Swap a model

替换模型

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

---
muapi workflow edit <id> --prompt "将视频模型从kling替换为veo3"

---

CLI Reference

CLI参考

bash
undefined
bash
undefined

List all your workflows

列出所有你的工作流

muapi workflow list
muapi workflow list

Browse templates

浏览模板

muapi workflow templates
muapi workflow templates

Generate new workflow

生成新工作流

muapi workflow create "text → flux image → upscale → face swap"
muapi workflow create "文本 → flux图像 → 放大 → 换脸"

Visualize a workflow

可视化工作流

muapi workflow get <id>
muapi workflow get <id>

Execute with inputs

带输入参数执行

muapi workflow execute <id> --input "node1.prompt=a sunset"
muapi workflow execute <id> --input "node1.prompt=a sunset"

Monitor a run

监控运行状态

muapi workflow status <run_id>
muapi workflow status <run_id>

Get outputs

获取输出结果

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

Edit with AI

用AI编辑工作流

muapi workflow edit <id> --prompt "add lipsync at the end"
muapi workflow edit <id> --prompt "在末尾添加唇形同步"

Rename / delete

重命名/删除

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

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

---

MCP Tools (for AI agents)

MCP工具(面向AI Agent)

ToolDescription
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

工具描述
muapi_workflow_list
列出用户的工作流
muapi_workflow_create
AI架构师:提示词 → 工作流
muapi_workflow_get
获取工作流定义 + 节点图
muapi_workflow_execute
带指定输入参数运行
muapi_workflow_status
逐节点运行状态
muapi_workflow_outputs
最终输出URL

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
  • 工作流可包含任意组合的muapi.ai节点(图像、视频、音频、增强、编辑)
  • 节点输出会自动连接到下游节点的输入
  • --sync
    模式最多等待120秒生成结果;复杂工作流请使用
    --async
    模式并单独轮询状态
  • 运行超时:每个工作流执行的最长时间为10分钟