Skip to main content
Glama

submit_workflow

Submit a ComfyUI workflow for asynchronous 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 handler function for the 'submit_workflow' tool. It submits the workflow to ComfyUI via POST /prompt and returns the prompt_id, number, and any node_errors without waiting for completion. Includes input schema via Pydantic Field descriptions and is registered via @mcp.tool() decorator.
    @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", {}),
        }
  • Within register_all_tools, calls register_execution_tools(mcp) which defines and registers the submit_workflow tool using @mcp.tool().
    register_workflow_tools(mcp)
    register_execution_tools(mcp)
  • Top-level registration call to register_all_tools(mcp), which chains to register_execution_tools(mcp) and thus 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