MCP Tool: create_workflow

Creates a new workflow with comprehensive definition and configuration. This tool allows you to define workflow steps, activities, triggers, and execution policies.

Example Prompt

Create a workflow for ticket escalation with notification and assignment steps

Input Parameters

NameTypeRequiredDescription
namestringYesThe name of the workflow
teamIdstringYesThe team ID that owns this workflow
typestringYesThe type of the workflow
subTypestringNoThe sub-type of the workflow
triggerEventobjectYesThe event that triggers this workflow
filtersobjectNoFilters to apply to the workflow trigger
annotationsarrayNoAnnotations for the workflow
workflowDefinitionarrayYesThe definition of workflow steps
executingAgentstringNoThe agent that executes this workflow
isActivebooleanNoWhether the workflow is active (default: true)
metadataobjectNoAdditional metadata for the workflow

Trigger Event Structure

FieldTypeRequiredDescription
uidstringYesThe unique identifier of the trigger event
eventNamestringYesThe name of the trigger event

Workflow Step Structure

Each step in the workflowDefinition array contains:
FieldTypeRequiredDescription
stepIdentifiernumberYesThe identifier for this step
activityobjectYesThe activity to execute in this step
inputobjectYesThe input parameters for this activity
retryPolicyobjectNoThe retry policy for this step
onFailurestringNoAction to take on failure (CONTINUE, ABORT, COMPENSATE)
isSleepActivitybooleanNoWhether this is a sleep/wait activity
executionTimeoutnumberNoTimeout for execution in seconds
approverobjectNoApprover configuration for this step
dependenciesarrayNoStep dependencies
filtersobjectNoFilters for this step

Activity Structure

FieldTypeRequiredDescription
uniqueIdentifierstringYesThe unique identifier of the activity
versionnumberNoThe version of the activity
autoUpgradeToLatestVersionbooleanNoWhether to automatically upgrade to the latest version (default: true)

Retry Policy Structure

FieldTypeRequiredDescription
maximumAttemptsnumberNoMaximum number of retry attempts
initialIntervalnumberNoInitial interval between retries in seconds
backoffCoefficientnumberNoBackoff coefficient for retry intervals

Approver Structure

FieldTypeRequiredDescription
typestringNoType of approver (TEAM or USER)
uidstringNoID of the approver
timeoutnumberNoTimeout for approval in seconds

Response Fields

The response will contain the created workflow with the same structure as the get_workflow tool.

Sample Response

{
  "data": {
    "uid": "WORKFLOW001",
    "type": "WORKFLOW",
    "subType": "AI_AGENT",
    "uniqueIdentifier": "ticket-escalation-workflow",
    "name": "Ticket Escalation Workflow",
    "version": 1,
    "triggerEvent": {
      "id": "EVENT001",
      "name": "ticket.created",
      "description": "Triggered when a new ticket is created"
    },
    "filters": {
      "priority": "high",
      "team": "support"
    },
    "annotations": [
      {
        "entityType": "workflow",
        "data": {
          "tags": ["escalation", "automation"]
        },
        "relations": []
      }
    ],
    "workflowDefinition": [
      {
        "stepIdentifier": 1,
        "activity": {
          "name": "send-notification",
          "uniqueIdentifier": "notification.activity",
          "version": 1,
          "autoUpgradeToLatestVersion": true
        },
        "input": {
          "recipients": ["support-team"],
          "message": "High priority ticket requires immediate attention",
          "priority": "urgent"
        },
        "retryPolicy": {
          "maximumAttempts": 3,
          "initialInterval": 1000,
          "backoffCoefficient": 2
        },
        "onFailure": "CONTINUE",
        "isSleepActivity": false,
        "executionTimeout": 30000,
        "dependencies": [],
        "filters": {
          "notificationType": "escalation"
        }
      },
      {
        "stepIdentifier": 2,
        "activity": {
          "name": "assign-to-senior-agent",
          "uniqueIdentifier": "assignment.activity",
          "version": 1,
          "autoUpgradeToLatestVersion": true
        },
        "input": {
          "priority": "high",
          "skillSet": ["escalation", "technical"],
          "autoAssign": true
        },
        "retryPolicy": {
          "maximumAttempts": 2,
          "initialInterval": 5000,
          "backoffCoefficient": 1.5
        },
        "onFailure": "ABORT",
        "isSleepActivity": false,
        "executionTimeout": 60000,
        "dependencies": [1],
        "filters": {
          "agentLevel": "senior"
        }
      }
    ],
    "executingAgent": "workflow-engine",
    "isActive": true,
    "createdAt": "2025-07-24T07:19:10.258Z",
    "updatedAt": "2025-07-24T07:19:10.258Z",
    "createdBy": "USER001",
    "teamId": "TEAM001",
    "metadata": {
      "description": "Automated workflow for escalating high-priority tickets",
      "tags": ["escalation", "automation", "support"],
      "category": "customer-service"
    }
  },
  "status": true,
  "message": "Workflow created successfully!",
  "timestamp": "2025-07-25T12:50:38.937Z"
}