{
  "openapi" : "3.1.0",
  "info" : {
    "title" : "API",
    "description" : "This section provides APIs for all workflow operations.",
    "version" : "1.0/workflow",
    "x-mo-original-description" : "API Documentation",
    "x-mo-overwrite-description" : "This section provides APIs for all workflow operations."
  },
  "servers" : [ {
    "url" : "http://workflow.platform"
  } ],
  "paths" : {
    "/workflow/workflow/v2/history/tasks/byInstanceId" : {
      "get" : {
        "tags" : [ "ProcessHistory" ],
        "summary" : "Get historic tasks by process instance id",
        "operationId" : "getHistoricTasksByProcessInstance",
        "parameters" : [ {
          "name" : "processInstanceId",
          "in" : "query",
          "description" : "Process Instance Id",
          "required" : true,
          "style" : "form",
          "explode" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "*/*" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/CloudTask"
                  }
                }
              }
            }
          }
        },
        "x-mo-since-at" : {
          "serviceVersion" : "2025.03"
        }
      }
    },
    "/workflow/workflow/v2/history/tasks/byKeys" : {
      "get" : {
        "tags" : [ "ProcessHistory" ],
        "summary" : "Get historic tasks by process definition and business key",
        "operationId" : "getHistoricTasksByProcessDefinition",
        "parameters" : [ {
          "name" : "processDefinitionKey",
          "in" : "query",
          "description" : "Process Definition Key",
          "required" : true,
          "style" : "form",
          "explode" : true,
          "schema" : {
            "type" : "string"
          }
        }, {
          "name" : "workflowBusinessKey",
          "in" : "query",
          "description" : "Process Instance Business Key",
          "required" : true,
          "style" : "form",
          "explode" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "*/*" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/CloudTask"
                  }
                }
              }
            }
          }
        },
        "x-mo-since-at" : {
          "serviceVersion" : "2025.03"
        }
      }
    },
    "/workflow/workflow/v2/process-instances" : {
      "post" : {
        "tags" : [ "ProcessInstance" ],
        "summary" : "Start process instances",
        "operationId" : "startProcess",
        "requestBody" : {
          "description" : "Start Process Payload",
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CloudStartProcessPayload"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "*/*" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/CloudTask"
                  }
                }
              }
            }
          }
        },
        "x-mo-since-at" : {
          "serviceVersion" : "2025.03"
        },
        "x-mo-original-summary" : "Start workflow process",
        "x-mo-overwrite-summary" : "Start process instances"
      }
    },
    "/workflow/workflow/v2/process-instances/cancel" : {
      "post" : {
        "tags" : [ "ProcessInstance" ],
        "summary" : "Cancel process instances",
        "operationId" : "cancelProcessInstance",
        "requestBody" : {
          "description" : "Delete Process Instance Payload",
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/DeleteProcessInstancePayload"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "OK"
          }
        },
        "x-mo-since-at" : {
          "serviceVersion" : "2025.03"
        },
        "x-mo-original-summary" : "Cancel process instance",
        "x-mo-overwrite-summary" : "Cancel process instances"
      }
    },
    "/workflow/workflow/v2/tasks" : {
      "post" : {
        "tags" : [ "Task" ],
        "summary" : "Query tasks by condition",
        "operationId" : "getTasksBySearchCondition",
        "requestBody" : {
          "description" : "searchCondition",
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/SearchCondition"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/QueryResult"
                }
              }
            }
          }
        },
        "x-mo-since-at" : {
          "serviceVersion" : "2025.03"
        },
        "x-mo-original-summary" : "Get tasks by query seachCondition",
        "x-mo-overwrite-summary" : "Query tasks by condition"
      }
    },
    "/workflow/workflow/v2/tasks/assign" : {
      "post" : {
        "tags" : [ "Task" ],
        "summary" : "Assign task by task id",
        "operationId" : "assignTask",
        "parameters" : [ {
          "name" : "mergeVariables",
          "in" : "query",
          "description" : "If Merger Query Variables ",
          "required" : false,
          "style" : "form",
          "explode" : true,
          "schema" : {
            "type" : "boolean"
          }
        } ],
        "requestBody" : {
          "description" : "assignTaskPayload",
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/AssignTaskPayload"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CloudTask"
                }
              }
            }
          }
        },
        "x-mo-since-at" : {
          "serviceVersion" : "2025.03"
        }
      }
    },
    "/workflow/workflow/v2/tasks/byBusinessKey" : {
      "get" : {
        "tags" : [ "Task" ],
        "summary" : "query tasks by business key",
        "operationId" : "getTasksByBusinessKey",
        "parameters" : [ {
          "name" : "processDefinitionKey",
          "in" : "query",
          "description" : "Process Definition Key",
          "required" : true,
          "style" : "form",
          "explode" : true,
          "schema" : {
            "type" : "string"
          }
        }, {
          "name" : "workflowBusinessKey",
          "in" : "query",
          "description" : "Process Instance Business Key",
          "required" : true,
          "style" : "form",
          "explode" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "*/*" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/CloudTask"
                  }
                }
              }
            }
          }
        },
        "x-mo-since-at" : {
          "serviceVersion" : "2025.03"
        },
        "x-mo-original-summary" : "Get task by BusinessKey",
        "x-mo-overwrite-summary" : "query tasks by business key"
      }
    },
    "/workflow/workflow/v2/tasks/complete" : {
      "post" : {
        "tags" : [ "Task" ],
        "summary" : "Complete task by task id",
        "operationId" : "completeTask",
        "requestBody" : {
          "description" : "completeTaskPayload",
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CloudCompleteTaskPayload"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "*/*" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/CloudTask"
                  }
                }
              }
            }
          }
        },
        "x-mo-since-at" : {
          "serviceVersion" : "2025.03"
        }
      }
    },
    "/workflow/workflow/v2/tasks/getTaskById" : {
      "get" : {
        "tags" : [ "Task" ],
        "summary" : "Get task by task id",
        "operationId" : "getTaskById",
        "parameters" : [ {
          "name" : "taskId",
          "in" : "query",
          "description" : "Task Id",
          "required" : true,
          "style" : "form",
          "explode" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CloudTask"
                }
              }
            }
          }
        },
        "x-mo-since-at" : {
          "serviceVersion" : "2025.03"
        }
      }
    },
    "/workflow/workflow/v2/tasks/revert" : {
      "post" : {
        "tags" : [ "Task" ],
        "summary" : "Revert task of process",
        "operationId" : "revertTask",
        "parameters" : [ {
          "name" : "taskId",
          "in" : "query",
          "description" : "Task Id",
          "required" : true,
          "style" : "form",
          "explode" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "description" : "revertTaskPayload",
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/RevertTaskPayload"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "OK"
          }
        },
        "x-mo-since-at" : {
          "serviceVersion" : "2025.03"
        }
      }
    },
    "/workflow/workflow/v2/tasks/update" : {
      "post" : {
        "tags" : [ "Task" ],
        "summary" : "Update task by task id",
        "operationId" : "updateTask",
        "requestBody" : {
          "description" : "updateTaskPayload",
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CloudUpdateTaskPayload"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CloudTask"
                }
              }
            }
          }
        },
        "x-mo-since-at" : {
          "serviceVersion" : "2025.03"
        }
      }
    },
    "/workflow/workflow/v2/tasks/variables" : {
      "post" : {
        "tags" : [ "Task" ],
        "summary" : "Update task query variables",
        "operationId" : "updateTaskQueryVariable",
        "requestBody" : {
          "description" : "updateVariablePayload",
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/UpdateVariablePayload"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CloudTask"
                }
              }
            }
          }
        },
        "x-mo-since-at" : {
          "serviceVersion" : "2025.03"
        },
        "x-mo-original-summary" : "Update query variables of workflow",
        "x-mo-overwrite-summary" : "Update task query variables"
      }
    }
  },
  "components" : {
    "schemas" : {
      "AssignTaskPayload" : {
        "type" : "object",
        "properties" : {
          "QueryVarsIncUpdated" : {
            "type" : "boolean"
          },
          "assignee" : {
            "type" : "string",
            "description" : "Process Task Assignee"
          },
          "controlVariables" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object",
              "description" : "Task control Variables"
            },
            "description" : "Task control Variables"
          },
          "dueDate" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "Process Task DueDate"
          },
          "indexSchema" : {
            "type" : "string",
            "description" : "Index Schema Name For Process Tasks"
          },
          "priority" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "Priority For Process Task"
          },
          "queryVariables" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object",
              "description" : "Process Task Query Variables"
            },
            "description" : "Process Task Query Variables"
          },
          "taskId" : {
            "type" : "string",
            "description" : "Task Id"
          }
        }
      },
      "CloudCompleteTaskPayload" : {
        "type" : "object",
        "properties" : {
          "QueryVarsIncUpdated" : {
            "type" : "boolean"
          },
          "assignee" : {
            "type" : "string",
            "description" : "Process Task Assignee"
          },
          "controlVariables" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object",
              "description" : "Task control Variables"
            },
            "description" : "Task control Variables"
          },
          "dueDate" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "Process Task DueDate"
          },
          "indexSchema" : {
            "type" : "string",
            "description" : "Index Schema Name For Process Tasks"
          },
          "priority" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "Priority For Process Task"
          },
          "queryVariables" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object",
              "description" : "Process Task Query Variables"
            },
            "description" : "Process Task Query Variables"
          },
          "taskId" : {
            "type" : "string",
            "description" : "Task Id"
          }
        }
      },
      "CloudStartProcessPayload" : {
        "type" : "object",
        "properties" : {
          "assignee" : {
            "type" : "string",
            "description" : "Process Task Assignee"
          },
          "businessKey" : {
            "type" : "string",
            "description" : "Process Instance Business Key"
          },
          "dueDate" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "Process Task DueDate"
          },
          "indexSchema" : {
            "type" : "string",
            "description" : "Index Schema Name For Process Tasks"
          },
          "priority" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "Priority For Process Task"
          },
          "processDefinitionKey" : {
            "type" : "string",
            "description" : "Process Definition Key"
          },
          "queryVariables" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object",
              "description" : "Process Task Query Variables"
            },
            "description" : "Process Task Query Variables"
          }
        }
      },
      "CloudTask" : {
        "type" : "object",
        "properties" : {
          "Assignee" : {
            "type" : "string"
          },
          "BusinessKey" : {
            "type" : "string"
          },
          "ClaimedDate" : {
            "type" : "string",
            "format" : "date-time"
          },
          "CompletedDate" : {
            "type" : "string",
            "format" : "date-time"
          },
          "CreatedDate" : {
            "type" : "string",
            "format" : "date-time"
          },
          "Description" : {
            "type" : "string"
          },
          "DocId" : {
            "type" : "string"
          },
          "DueDate" : {
            "type" : "string",
            "format" : "date-time"
          },
          "Duration" : {
            "type" : "integer",
            "format" : "int64"
          },
          "FormKey" : {
            "type" : "string"
          },
          "Id" : {
            "type" : "string"
          },
          "Name" : {
            "type" : "string"
          },
          "Owner" : {
            "type" : "string"
          },
          "ParentTaskId" : {
            "type" : "string"
          },
          "Priority" : {
            "type" : "integer",
            "format" : "int32"
          },
          "ProcessDefinitionId" : {
            "type" : "string"
          },
          "ProcessDefinitionVersion" : {
            "type" : "integer",
            "format" : "int32"
          },
          "ProcessInstanceId" : {
            "type" : "string"
          },
          "QueryVariables" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object"
            }
          },
          "Status" : {
            "type" : "string",
            "enum" : [ "CREATED", "ASSIGNED", "SUSPENDED", "COMPLETED", "CANCELLED", "DELETED" ]
          },
          "TaskDefinitionKey" : {
            "type" : "string"
          }
        }
      },
      "CloudUpdateTaskPayload" : {
        "type" : "object",
        "properties" : {
          "DueDateUpdated" : {
            "type" : "boolean"
          },
          "PriorityUpdated" : {
            "type" : "boolean"
          },
          "QueryVarsIncUpdated" : {
            "type" : "boolean"
          },
          "assignee" : {
            "type" : "string",
            "description" : "Process Task Assignee"
          },
          "controlVariables" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object",
              "description" : "Task control Variables"
            },
            "description" : "Task control Variables"
          },
          "dueDate" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "Process Task DueDate"
          },
          "indexSchema" : {
            "type" : "string",
            "description" : "Index Schema Name For Process Tasks"
          },
          "priority" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "Priority For Process Task"
          },
          "queryVariables" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object",
              "description" : "Task Query Variables"
            },
            "description" : "Task Query Variables"
          },
          "taskId" : {
            "type" : "string",
            "description" : "Task Id"
          }
        }
      },
      "DeleteProcessInstancePayload" : {
        "type" : "object",
        "properties" : {
          "businessKey" : {
            "type" : "string",
            "description" : "Process Instance Business Key"
          },
          "indexSchema" : {
            "type" : "string",
            "description" : "Index Schema Name For Process Tasks"
          },
          "processDefinitionKey" : {
            "type" : "string",
            "description" : "Process Definition Key"
          },
          "processInstanceId" : {
            "type" : "string",
            "description" : "Process Instance Id"
          },
          "reason" : {
            "type" : "string",
            "description" : "Reason for Process Instance Delete"
          }
        }
      },
      "GroupResult" : {
        "type" : "object",
        "properties" : {
          "EsDocs" : {
            "type" : "array",
            "items" : {
              "type" : "object",
              "additionalProperties" : {
                "type" : "object"
              }
            }
          },
          "GroupTotalNum" : {
            "type" : "integer",
            "format" : "int64"
          },
          "GroupValue" : {
            "type" : "string"
          },
          "InnerDocs" : {
            "type" : "array",
            "items" : {
              "type" : "object",
              "additionalProperties" : {
                "type" : "object"
              }
            }
          }
        }
      },
      "QueryResult" : {
        "type" : "object",
        "properties" : {
          "AggConditions" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object"
            }
          },
          "Aggs" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object"
            }
          },
          "GroupField" : {
            "type" : "string"
          },
          "MaxPageCount" : {
            "type" : "integer",
            "format" : "int64"
          },
          "PageNo" : {
            "type" : "integer",
            "format" : "int32"
          },
          "PageSize" : {
            "type" : "integer",
            "format" : "int32"
          },
          "Results" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/GroupResult"
            }
          },
          "Total" : {
            "type" : "integer",
            "format" : "int64"
          }
        }
      },
      "RevertTaskPayload" : {
        "type" : "object",
        "properties" : {
          "NewTaskId" : {
            "type" : "string"
          },
          "assignee" : {
            "type" : "string",
            "description" : "Process Task Assignee"
          },
          "dueDate" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "Process Task DueDate"
          },
          "indexSchema" : {
            "type" : "string",
            "description" : "Index Schema Name For Process Tasks"
          },
          "priority" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "Priority For Process Task"
          },
          "queryVariables" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object",
              "description" : "Process Task Query Variables"
            },
            "description" : "Process Task Query Variables"
          }
        }
      },
      "SearchCondition" : {
        "type" : "object",
        "properties" : {
          "AggConditions" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object"
            }
          },
          "Conditions" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object"
            }
          },
          "ConditionsMapLinkedWithOrList" : {
            "type" : "array",
            "items" : {
              "type" : "object",
              "additionalProperties" : {
                "type" : "object"
              }
            }
          },
          "ExcludeFields" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          },
          "ExistFields" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          },
          "FromRangeConditions" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object"
            }
          },
          "FuzzyConditions" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object"
            }
          },
          "GroupField" : {
            "type" : "string"
          },
          "InConditions" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "array",
              "items" : {
                "type" : "object"
              }
            }
          },
          "IncludeFields" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          },
          "Module" : {
            "type" : "string"
          },
          "NotExistFields" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          },
          "NotInConditions" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "array",
              "items" : {
                "type" : "object"
              }
            }
          },
          "OrConditions" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object"
            }
          },
          "OrConditionsList" : {
            "type" : "array",
            "items" : {
              "type" : "object",
              "additionalProperties" : {
                "type" : "object"
              }
            }
          },
          "OrFuzzyConditions" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object"
            }
          },
          "OrFuzzyConditionsList" : {
            "type" : "array",
            "items" : {
              "type" : "object",
              "additionalProperties" : {
                "type" : "object"
              }
            }
          },
          "OrInConditions" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "array",
              "items" : {
                "type" : "object"
              }
            }
          },
          "PageNo" : {
            "type" : "integer",
            "format" : "int32"
          },
          "PageSize" : {
            "type" : "integer",
            "format" : "int32"
          },
          "ParentSearchCondition" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/SearchCondition"
            }
          },
          "SearchType" : {
            "type" : "integer",
            "format" : "int32"
          },
          "ServerName" : {
            "type" : "string"
          },
          "SortField" : {
            "type" : "string"
          },
          "SortFieldAndTypeList" : {
            "type" : "array",
            "items" : {
              "type" : "object",
              "additionalProperties" : {
                "type" : "string"
              }
            }
          },
          "SortType" : {
            "type" : "string"
          },
          "ToRangeConditions" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object"
            }
          },
          "TransType" : {
            "type" : "string"
          },
          "UrpContent" : {
            "type" : "string"
          },
          "UseDeputyAnalyzers" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "string"
            }
          },
          "WithCodeDesc" : {
            "type" : "boolean"
          }
        }
      },
      "UpdateVariablePayload" : {
        "type" : "object",
        "properties" : {
          "SearchCondition" : {
            "$ref" : "#/components/schemas/SearchCondition"
          },
          "indexSchema" : {
            "type" : "string",
            "description" : "Index Schema Name For Process Tasks"
          },
          "updateVariables" : {
            "type" : "object",
            "additionalProperties" : {
              "type" : "object",
              "description" : "Updated Variables"
            },
            "description" : "Updated Variables"
          }
        }
      }
    }
  },
  "x-mo-gateway-auth-enabled" : true,
  "x-mo-gateway-cors-enabled" : false
}