Skip to main content
Glama

submit_workflow

Submit a ComfyUI workflow for execution and receive a prompt ID for tracking progress without waiting for completion.

Instructions

Submit a workflow without waiting for completion.

Args: workflow: Workflow dict to execute Returns the prompt_id for tracking. Use get_history() or get_prompt_status() to check completion.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflowYesWorkflow to submit

Implementation Reference

  • The primary implementation of the 'submit_workflow' MCP tool. This function is decorated with @mcp.tool() for automatic registration and schema definition via Pydantic Field annotations. It submits the provided workflow dictionary to the ComfyUI server via POST /prompt and returns a dictionary containing the prompt_id, number, and any node_errors.
    @mcp.tool() def submit_workflow( workflow: dict = Field(description="Workflow to submit"), ctx: Context = None, ) -> dict: """Submit a workflow without waiting for completion. Args: workflow: Workflow dict to execute Returns the prompt_id for tracking. Use get_history() or get_prompt_status() to check completion. """ if ctx: ctx.info("Submitting workflow...") status, resp = comfy_post("/prompt", {"prompt": workflow}) if status != 200: return ErrorResponse( error=f"Submit failed: status {status}", code="SUBMIT_FAILED", details=resp, ).model_dump() return { "prompt_id": resp.get("prompt_id"), "number": resp.get("number"), "node_errors": resp.get("node_errors", {}), }
  • High-level registration function that calls register_execution_tools(mcp), which in turn defines and registers the submit_workflow tool among others.
    def register_all_tools(mcp): """Register all tools with the MCP server.""" register_system_tools(mcp) register_discovery_tools(mcp) register_workflow_tools(mcp) register_execution_tools(mcp)
  • Top-level call to register_all_tools during server initialization, which indirectly registers the submit_workflow tool.
    register_all_tools(mcp)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/IO-AtelierTech/comfyui-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server