MCP Tool: update_workflow

Updates an existing workflow’s definition and configuration. This tool allows you to modify workflow steps, activities, triggers, and execution policies while preserving the workflow’s unique identifier.

Example Prompt

Update workflow "ticket-escalation-workflow" to add a new notification step and modify the retry policy

Input Parameters

NameTypeRequiredDescription
workflowUniqueIdentifierstringYesThe unique identifier of the workflow to update
namestringNoThe updated name of the workflow
teamIdstringNoThe team ID that owns this workflow
triggerEventobjectNoThe event that triggers this workflow
filtersobjectNoFilters to apply to the workflow trigger
annotationsarrayNoAnnotations for the workflow
workflowDefinitionarrayNoThe definition of workflow steps
executingAgentstringNoThe agent that executes this workflow
isActivebooleanNoWhether the workflow is active
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 updated 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": "Enhanced Ticket Escalation Workflow",
    "version": 2,
    "triggerEvent": {
      "id": "EVENT001",
      "name": "ticket.created",
      "description": "Triggered when a new ticket is created"
    },
    "filters": {
      "priority": "high",
      "team": "support",
      "autoEscalate": true,
      "escalationThreshold": 15
    },
    "annotations": [
      {
        "entityType": "workflow",
        "data": {
          "tags": ["escalation", "automation", "enhanced"]
        },
        "relations": []
      }
    ],
    "workflowDefinition": [
      {
        "stepIdentifier": 1,
        "activity": {
          "name": "send-notification",
          "uniqueIdentifier": "notification.activity",
          "version": 2,
          "autoUpgradeToLatestVersion": true
        },
        "input": {
          "recipients": ["support-team", "senior-agents"],
          "message": "High priority ticket requires immediate attention",
          "priority": "urgent",
          "includeMetrics": true
        },
        "retryPolicy": {
          "maximumAttempts": 5,
          "initialInterval": 2000,
          "backoffCoefficient": 2.5
        },
        "onFailure": "CONTINUE",
        "isSleepActivity": false,
        "executionTimeout": 45000,
        "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", "senior"],
          "autoAssign": true,
          "loadBalancing": true
        },
        "retryPolicy": {
          "maximumAttempts": 3,
          "initialInterval": 5000,
          "backoffCoefficient": 1.5
        },
        "onFailure": "ABORT",
        "isSleepActivity": false,
        "executionTimeout": 60000,
        "dependencies": [1],
        "filters": {
          "agentLevel": "senior"
        }
      },
      {
        "stepIdentifier": 3,
        "activity": {
          "name": "update-ticket-status",
          "uniqueIdentifier": "status-update.activity",
          "version": 1,
          "autoUpgradeToLatestVersion": true
        },
        "input": {
          "status": "escalated",
          "comment": "Automatically escalated due to high priority",
          "addTimestamp": true
        },
        "retryPolicy": {
          "maximumAttempts": 2,
          "initialInterval": 1000,
          "backoffCoefficient": 1
        },
        "onFailure": "CONTINUE",
        "isSleepActivity": false,
        "executionTimeout": 15000,
        "dependencies": [2],
        "filters": {}
      }
    ],
    "executingAgent": "workflow-engine-v2",
    "isActive": true,
    "createdAt": "2025-07-24T07:19:10.258Z",
    "updatedAt": "2025-07-25T12:50:38.937Z",
    "createdBy": "USER001",
    "teamId": "TEAM001",
    "metadata": {
      "description": "Enhanced automated workflow for escalating high-priority tickets",
      "tags": ["escalation", "automation", "support", "enhanced"],
      "category": "customer-service",
      "version": "2.0",
      "lastUpdated": "2025-07-25T12:50:38.937Z"
    }
  },
  "status": true,
  "message": "Workflow updated successfully!",
  "timestamp": "2025-07-25T12:50:38.937Z"
}