Workflows let you chain multiple AI models into automated, multi-step pipelines — connecting image generators, video models, audio tools, and more into a single reusable flow. Every workflow you build in the visual Workflow Studio can also be executed via the API, which means you can trigger complete pipelines from your own application code without any UI interaction. The functions documented here are exported fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/anil-matcha/open-generative-ai/llms.txt
Use this file to discover all available pages before exploring further.
packages/studio/src/muapi.js and cover the full lifecycle: listing, creating, managing, inspecting, and running both workflows and agents.
Workflow Management
These functions let you list, create, rename, and delete workflow definitions. All calls authenticate via thex-api-key header using your Muapi.ai API key.
getTemplateWorkflows(apiKey)
Fetch the curated library of pre-built workflow templates. Templates are a good starting point — fork one and modify it rather than building from scratch.
Your Muapi.ai API key. Obtain one at muapi.ai/access-keys.
Promise<Array> — an array of template workflow objects.
getUserWorkflows(apiKey)
Retrieve all workflows saved to your account. The returned id field is the workflowId used in every other workflow call.
Your Muapi.ai API key.
Promise<Array> — an array of workflow definition objects belonging to the authenticated user.
getPublishedWorkflows(apiKey)
Fetch community-published workflows shared by other Muapi.ai users. Published workflows can be executed directly using executeWorkflow.
Your Muapi.ai API key.
Promise<Array> — an array of publicly published workflow objects.
createWorkflow(apiKey, payload)
Create a new workflow definition under your account. The payload describes the workflow structure — you can start with a template definition or build one from scratch using the node schema.
Your Muapi.ai API key.
Promise<object> — the created workflow object, including the new id.
updateWorkflowName(apiKey, workflowId, name)
Rename an existing workflow. This is a lightweight POST to /workflow/update-name/{workflowId} and does not change the workflow structure.
Your Muapi.ai API key.
The ID of the workflow to rename (from
getUserWorkflows).The new display name for the workflow.
Promise<object> — the updated workflow object.
deleteWorkflow(apiKey, workflowId)
Permanently delete a workflow definition. This action cannot be undone.
Your Muapi.ai API key.
The ID of the workflow to delete.
Promise<object> — a confirmation response from the API.
getWorkflowInputs(apiKey, workflowId)
Fetch the input schema for a specific workflow. Use this before calling executeWorkflow to discover which keys the inputs object must contain and what types are expected.
Your Muapi.ai API key.
The workflow whose input schema you want to inspect.
Promise<object> — a schema object mapping input field names to their type definitions and constraints.
getWorkflowData(apiKey, workflowId)
Retrieve the complete workflow definition, including all node configurations and edge connections. Useful for inspecting or cloning an existing workflow.
Your Muapi.ai API key.
The workflow to inspect.
Promise<object> — the full workflow definition object.
getAllNodeSchemas(apiKey, workflowId)
Get the schemas for every node in a workflow, including internal node types. This is the lower-level counterpart to getNodeSchemas — it returns the full set of node schemas without filtering to API-exposed ones only.
Your Muapi.ai API key.
The workflow to inspect.
Promise<object> — all node schemas in the workflow.
getNodeSchemas(apiKey, workflowId)
Get only the API-exposed node schemas for a workflow. These are the nodes that can be targeted individually via runSingleNode. The endpoint is /workflow/{workflowId}/api-node-schemas.
Your Muapi.ai API key.
The workflow to inspect.
Promise<object> — a map of API-accessible node IDs to their input/output schemas.
Execute a Workflow
executeWorkflow(apiKey, workflowId, inputs)
Run a complete workflow end-to-end. The function posts the inputs to /workflow/{workflowId}/api-execute, receives a run_id, then automatically polls /workflow/run/{run_id}/api-outputs every two seconds until the status is completed, succeeded, or success. The maximum polling window is 30 minutes (900 attempts × 2 s).
Your Muapi.ai API key.
The ID of the workflow to execute. Obtain this from
getUserWorkflows or getTemplateWorkflows.Key-value pairs matching the workflow’s input schema. Call
getWorkflowInputs first to discover the required keys and their types.Promise<object> — resolves to the completed workflow run result when execution finishes. Rejects with an error if the workflow fails or times out.
Example — discover inputs, then execute:
Node Execution
These functions let you run a single node in isolation or monitor and cancel an in-progress node run.runSingleNode(apiKey, workflowId, nodeId, payload)
Execute a single node within a workflow without running the entire pipeline. The node ID must correspond to an API-exposed node from getNodeSchemas.
Your Muapi.ai API key.
The workflow that contains the node.
The ID of the node to run (from
getNodeSchemas).Input values for the node, matching the node’s input schema.
Promise<object> — a run object including a run_id for status polling.
deleteNodeRun(apiKey, nodeRunId)
Cancel an in-progress node run. Issues a DELETE to /workflow/node-run/{nodeRunId}.
Your Muapi.ai API key.
The
run_id returned by runSingleNode.Promise<object> — a confirmation response from the API.
getNodeStatus(apiKey, runId)
Poll the current status of a running or completed node. The endpoint is /workflow/run/{runId}/status.
Your Muapi.ai API key.
The run ID to check.
Promise<object> — a status object including a status field and any available output data.
Agents
Agents are conversational AI assistants that can be configured with specific capabilities and context. The agent functions mirror the workflow listing pattern.getTemplateAgents(apiKey)
Fetch the library of pre-built agent templates from /agents/templates/agents.
Your Muapi.ai API key.
Promise<Array> — an array of agent template objects.
getUserAgents(apiKey)
Retrieve agents saved to the authenticated user’s account from /agents/user/agents.
Your Muapi.ai API key.
Promise<Array> — an array of the user’s agent objects.
getPublishedAgents(apiKey)
Fetch featured community agents from /agents/featured/agents.
Your Muapi.ai API key.
Promise<Array> — an array of publicly featured agent objects.
getUserConversations(apiKey)
Retrieve the authenticated user’s full conversation history across all agents from /agents/user/conversations.
Your Muapi.ai API key.
Promise<Array> — an array of conversation objects. Returns an empty array if the response is not an array.
Credit and Balance Utilities
calculateDynamicCost(apiKey, taskName, payload)
Estimate the credit cost of a generation task before submitting it. Send the same taskName and payload you intend to pass to the generation function to get a preview of how many credits will be consumed.
Your Muapi.ai API key.
The model endpoint name (e.g.
'kling-v3', 'flux-kontext-dev').The same parameters you plan to send to the generation call.
Promise<object> — an object containing the estimated credit cost.
getUserBalance(apiKey)
Check the remaining credit balance on your Muapi.ai account. Calls GET /api/v1/account/balance.
Your Muapi.ai API key.
Promise<object> — an object containing the current credit balance.
Call
getUserBalance before long or expensive workflow runs to confirm you have sufficient credits. Pair it with calculateDynamicCost to build a pre-flight check before executing.