MCP Tools
Workflows

run_workflow

Manually dispatch a workflow run. Creates a workflow_run row and dispatches a Managed Agents session. Returns the run row — check .status to know what happened.

Input Schema

{
  "type": "object",
  "required": [
    "workflow_id"
  ],
  "properties": {
    "workflow_id": {
      "type": "string",
      "format": "uuid",
      "description": "UUID of the workflow template to run."
    },
    "input_values": {
      "type": "object",
      "description": "Values for the workflow's declared inputs, if any.",
      "additionalProperties": true
    }
  },
  "additionalProperties": false
}

Output Schema

{
  "type": "object",
  "required": [
    "id",
    "workflow_template_id",
    "status",
    "team_id",
    "link_url"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Run UUID."
    },
    "status": {
      "enum": [
        "pending",
        "running",
        "failed",
        "succeeded",
        "skipped"
      ],
      "type": "string"
    },
    "team_id": {
      "type": "integer"
    },
    "link_url": {
      "type": "string",
      "format": "uri",
      "description": "Direct link to this run in MarketCore. Format: https://app.marketcore.ai/workflows/{workflow_id}/runs/{run_id}"
    },
    "created_at": {
      "type": "integer"
    },
    "error_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "trigger_type": {
      "type": "string"
    },
    "runner_session_id": {
      "type": "string"
    },
    "workflow_template_id": {
      "type": "string",
      "format": "uuid",
      "description": "UUID of the workflow that was run."
    }
  }
}

Instructions

Manually run a workflow. Creates a workflow_run and dispatches a Managed Agents session. Returns the run row — check .status to know what happened.

Input roles:

  • workflow_id: integer id of the workflow to run.
  • input_values: object matching the workflow's declared inputs schema. Call get_workflow first if unsure.

Usage patterns:

  • Always inspect the returned .status:
    • "running" → dispatch succeeded; a real Managed Agents session is live.
    • "failed" → dispatch failed; .error_reason has the cause. Tell the user specifically what went wrong.
    • "skipped" → the runner decided no work was needed (rare for manual runs, common for scheduled).
  • For scheduled runs, prefer creating a trigger via create_workflow's schedule_config — don't loop run_workflow calls.
  • input_values must match workflow.inputs schema. For workflows with no declared inputs, pass {} or omit.
Scroll to Top