@epilot/sdk 2.20.86 → 2.20.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/definitions/workflow-runtime.json +1 -1
- package/definitions/workflow.json +4072 -1386
- package/dist/apis/access-token.cjs +6 -6
- package/dist/apis/access-token.js +1 -1
- package/dist/apis/address-suggestions.cjs +6 -6
- package/dist/apis/address-suggestions.js +1 -1
- package/dist/apis/address.cjs +6 -6
- package/dist/apis/address.js +1 -1
- package/dist/apis/ai-agents.cjs +6 -6
- package/dist/apis/ai-agents.js +1 -1
- package/dist/apis/app.cjs +6 -6
- package/dist/apis/app.js +1 -1
- package/dist/apis/audit-logs.cjs +6 -6
- package/dist/apis/audit-logs.js +1 -1
- package/dist/apis/automation.cjs +6 -6
- package/dist/apis/automation.js +1 -1
- package/dist/apis/billing.cjs +6 -6
- package/dist/apis/billing.js +1 -1
- package/dist/apis/blueprint-manifest.cjs +6 -6
- package/dist/apis/blueprint-manifest.js +1 -1
- package/dist/apis/calendar.cjs +6 -6
- package/dist/apis/calendar.js +1 -1
- package/dist/apis/chat.cjs +6 -6
- package/dist/apis/chat.js +1 -1
- package/dist/apis/configuration-hub.cjs +6 -6
- package/dist/apis/configuration-hub.js +1 -1
- package/dist/apis/consent.cjs +6 -6
- package/dist/apis/consent.js +1 -1
- package/dist/apis/customer-portal.cjs +6 -6
- package/dist/apis/customer-portal.js +1 -1
- package/dist/apis/dashboard.cjs +6 -6
- package/dist/apis/dashboard.js +1 -1
- package/dist/apis/data-governance.cjs +6 -6
- package/dist/apis/data-governance.js +1 -1
- package/dist/apis/deduplication.cjs +6 -6
- package/dist/apis/deduplication.js +1 -1
- package/dist/apis/design.cjs +6 -6
- package/dist/apis/design.js +1 -1
- package/dist/apis/document.cjs +6 -6
- package/dist/apis/document.js +1 -1
- package/dist/apis/email-settings.cjs +6 -6
- package/dist/apis/email-settings.js +1 -1
- package/dist/apis/email-template.cjs +6 -6
- package/dist/apis/email-template.js +1 -1
- package/dist/apis/entity-mapping.cjs +6 -6
- package/dist/apis/entity-mapping.js +1 -1
- package/dist/apis/entity.cjs +6 -6
- package/dist/apis/entity.js +1 -1
- package/dist/apis/environments.cjs +6 -6
- package/dist/apis/environments.js +1 -1
- package/dist/apis/event-catalog.cjs +6 -6
- package/dist/apis/event-catalog.js +1 -1
- package/dist/apis/external-values.cjs +6 -6
- package/dist/apis/external-values.js +1 -1
- package/dist/apis/file.cjs +6 -6
- package/dist/apis/file.js +1 -1
- package/dist/apis/iban.cjs +6 -6
- package/dist/apis/iban.js +1 -1
- package/dist/apis/identity.cjs +6 -6
- package/dist/apis/identity.js +1 -1
- package/dist/apis/integration-toolkit.cjs +6 -6
- package/dist/apis/integration-toolkit.js +1 -1
- package/dist/apis/journey.cjs +6 -6
- package/dist/apis/journey.js +1 -1
- package/dist/apis/kanban.cjs +6 -6
- package/dist/apis/kanban.js +1 -1
- package/dist/apis/message.cjs +6 -6
- package/dist/apis/message.js +1 -1
- package/dist/apis/metering.cjs +6 -6
- package/dist/apis/metering.js +1 -1
- package/dist/apis/notes.cjs +6 -6
- package/dist/apis/notes.js +1 -1
- package/dist/apis/notification.cjs +6 -6
- package/dist/apis/notification.js +1 -1
- package/dist/apis/organization.cjs +6 -6
- package/dist/apis/organization.js +1 -1
- package/dist/apis/partner-directory.cjs +6 -6
- package/dist/apis/partner-directory.js +1 -1
- package/dist/apis/permissions.cjs +6 -6
- package/dist/apis/permissions.js +1 -1
- package/dist/apis/phone-integration.cjs +6 -6
- package/dist/apis/phone-integration.js +1 -1
- package/dist/apis/pricing-tier.cjs +6 -6
- package/dist/apis/pricing-tier.js +1 -1
- package/dist/apis/pricing.cjs +6 -6
- package/dist/apis/pricing.js +1 -1
- package/dist/apis/purpose.cjs +6 -6
- package/dist/apis/purpose.js +1 -1
- package/dist/apis/query.cjs +6 -6
- package/dist/apis/query.js +1 -1
- package/dist/apis/sandbox.cjs +6 -6
- package/dist/apis/sandbox.js +1 -1
- package/dist/apis/sharing.cjs +6 -6
- package/dist/apis/sharing.js +1 -1
- package/dist/apis/snapshot.cjs +6 -6
- package/dist/apis/snapshot.js +1 -1
- package/dist/apis/submission.cjs +6 -6
- package/dist/apis/submission.js +1 -1
- package/dist/apis/target.cjs +6 -6
- package/dist/apis/target.js +1 -1
- package/dist/apis/targeting.cjs +6 -6
- package/dist/apis/targeting.js +1 -1
- package/dist/apis/template-variables.cjs +6 -6
- package/dist/apis/template-variables.js +1 -1
- package/dist/apis/user.cjs +6 -6
- package/dist/apis/user.js +1 -1
- package/dist/apis/validation-rules.cjs +6 -6
- package/dist/apis/validation-rules.js +1 -1
- package/dist/apis/webhooks.cjs +6 -6
- package/dist/apis/webhooks.js +1 -1
- package/dist/apis/workflow-definition.cjs +6 -6
- package/dist/apis/workflow-definition.js +1 -1
- package/dist/apis/workflow.cjs +8 -8
- package/dist/apis/workflow.d.cts +2 -2
- package/dist/apis/workflow.d.ts +2 -2
- package/dist/apis/workflow.js +2 -2
- package/dist/{chunk-2AWPRVIH.js → chunk-AMLTCPBT.js} +2 -2
- package/dist/{chunk-NMY7ACYO.cjs → chunk-PQONAXAH.cjs} +2 -2
- package/dist/chunk-SWEH4LP3.cjs +14 -0
- package/dist/chunk-W5OQ3L53.js +14 -0
- package/dist/index.cjs +10 -10
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/workflow-B5IJTSPX.js +7 -0
- package/dist/workflow-GOWWDU4Y.cjs +7 -0
- package/dist/{workflow-runtime-L5HMFISV.js → workflow-runtime-GPXNF7WI.js} +1 -1
- package/dist/{workflow-runtime-LMGACZP4.cjs → workflow-runtime-HD6U5ZSL.cjs} +2 -2
- package/dist/workflow.d-B7utaxgb.d.cts +6868 -0
- package/dist/workflow.d-B7utaxgb.d.ts +6868 -0
- package/docs/workflow.md +4537 -1746
- package/package.json +1 -1
- package/dist/chunk-522LYPPW.js +0 -14
- package/dist/chunk-PM25LLET.cjs +0 -14
- package/dist/workflow-JQT3F5NJ.cjs +0 -7
- package/dist/workflow-Q6FAE5OL.js +0 -7
- package/dist/workflow.d-5cyNJgVQ.d.cts +0 -3843
- package/dist/workflow.d-5cyNJgVQ.d.ts +0 -3843
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NJK5F5TF.cjs');
|
|
2
|
+
|
|
3
|
+
// src/docs/workflow.json
|
|
4
|
+
var workflow_default = '# Workflows Executions\n\n- **Base URL:** `https://workflows-execution.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/workflow](https://docs.epilot.io/api/workflow)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.workflow.getExecutions(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/workflow\'\n\nconst workflowClient = getClient()\nauthorize(workflowClient, () => \'<token>\')\nconst { data } = await workflowClient.getExecutions(...)\n```\n\n## Operations\n\n**Workflow Executions**\n- [`getExecutions`](#getexecutions)\n- [`createExecution`](#createexecution)\n- [`getExecution`](#getexecution)\n- [`updateExecution`](#updateexecution)\n- [`deleteExecution`](#deleteexecution)\n\n**Workflow Steps**\n- [`createStep`](#createstep)\n- [`updateStep`](#updatestep)\n- [`deleteStep`](#deletestep)\n\n**Closing Reasons**\n- [`getClosingReasonExecution`](#getclosingreasonexecution)\n\n**Flows V2**\n- [`startFlowExecution`](#startflowexecution)\n- [`getFlowExecution`](#getflowexecution)\n- [`patchFlowExecution`](#patchflowexecution)\n- [`deleteFlowExecution`](#deleteflowexecution)\n- [`searchFlowExecutions`](#searchflowexecutions)\n- [`bulkStartFlows`](#bulkstartflows)\n- [`listBulkStartFlowsJobs`](#listbulkstartflowsjobs)\n- [`getActiveBulkStartFlowsJob`](#getactivebulkstartflowsjob)\n- [`getBulkStartFlowsJob`](#getbulkstartflowsjob)\n- [`patchBulkStartFlowsJob`](#patchbulkstartflowsjob)\n- [`restartBulkStartFlowsJob`](#restartbulkstartflowsjob)\n- [`patchTask`](#patchtask)\n- [`runTaskAutomation`](#runtaskautomation)\n- [`previewTaskEmail`](#previewtaskemail)\n- [`executeTask`](#executetask)\n- [`patchPhase`](#patchphase)\n- [`addTask`](#addtask)\n- [`cancelTaskSchedule`](#canceltaskschedule)\n- [`reconcileAutomationTask`](#reconcileautomationtask)\n- [`runTaskScheduleNow`](#runtaskschedulenow)\n\n**Portal Workflows**\n- [`searchPortalWorkflows`](#searchportalworkflows)\n- [`searchPortalWorkflowsBatch`](#searchportalworkflowsbatch)\n\n**Schemas**\n- [`WorkflowExecutionCreateReq`](#workflowexecutioncreatereq)\n- [`WorkflowExecutionUpdateReq`](#workflowexecutionupdatereq)\n- [`ClosingReason`](#closingreason)\n- [`WorkflowContext`](#workflowcontext)\n- [`WorkflowExecutionBase`](#workflowexecutionbase)\n- [`WorkflowExecutionSlim`](#workflowexecutionslim)\n- [`FlowSlim`](#flowslim)\n- [`Flow`](#flow)\n- [`WorkflowExecution`](#workflowexecution)\n- [`WorkflowStatus`](#workflowstatus)\n- [`SectionSimplified`](#sectionsimplified)\n- [`Section`](#section)\n- [`StepId`](#stepid)\n- [`StepSimplified`](#stepsimplified)\n- [`Step`](#step)\n- [`StepExtended`](#stepextended)\n- [`StepStatus`](#stepstatus)\n- [`SectionStatus`](#sectionstatus)\n- [`StepType`](#steptype)\n- [`StepJourney`](#stepjourney)\n- [`JourneyContextParameter`](#journeycontextparameter)\n- [`AiPrefillConfig`](#aiprefillconfig)\n- [`AiPrefillExtractionField`](#aiprefillextractionfield)\n- [`AiPrefillMapping`](#aiprefillmapping)\n- [`JourneyPrefill`](#journeyprefill)\n- [`AutomationConfig`](#automationconfig)\n- [`ECPDetails`](#ecpdetails)\n- [`PartnerDetails`](#partnerdetails)\n- [`StepDescription`](#stepdescription)\n- [`ItemType`](#itemtype)\n- [`TriggerType`](#triggertype)\n- [`CreateStepReq`](#createstepreq)\n- [`UpdateStepReq`](#updatestepreq)\n- [`StepPositionAt`](#steppositionat)\n- [`UpdateStepResp`](#updatestepresp)\n- [`SearchStepsResp`](#searchstepsresp)\n- [`SearchExecutionsReq`](#searchexecutionsreq)\n- [`SearchExecutionsResp`](#searchexecutionsresp)\n- [`LastEvaluatedKey`](#lastevaluatedkey)\n- [`SearchStepsReq`](#searchstepsreq)\n- [`SearchSorting`](#searchsorting)\n- [`SearchPagination`](#searchpagination)\n- [`ExecutionPaginationDynamo`](#executionpaginationdynamo)\n- [`ErrorResp`](#errorresp)\n- [`ClosingReasonResp`](#closingreasonresp)\n- [`PhaseInEntity`](#phaseinentity)\n- [`TaskInEntity`](#taskinentity)\n- [`WorkflowInEntity`](#workflowinentity)\n- [`UpdateEntityAttributes`](#updateentityattributes)\n- [`EntitySync`](#entitysync)\n- [`DynamicDueDate`](#dynamicduedate)\n- [`StepRequirement`](#steprequirement)\n- [`StartFlowReq`](#startflowreq)\n- [`SearchFlowsReq`](#searchflowsreq)\n- [`PortalWorkflowsSearchReq`](#portalworkflowssearchreq)\n- [`PortalAudience`](#portalaudience)\n- [`PortalWorkflowsSearchResp`](#portalworkflowssearchresp)\n- [`BulkStartFlowsReq`](#bulkstartflowsreq)\n- [`BulkStartEntityRef`](#bulkstartentityref)\n- [`BulkStartFlowsJobStatus`](#bulkstartflowsjobstatus)\n- [`BulkStartFlowsItemStatus`](#bulkstartflowsitemstatus)\n- [`BulkStartFlowsItem`](#bulkstartflowsitem)\n- [`BulkStartFlowsFlowSummary`](#bulkstartflowsflowsummary)\n- [`BulkStartFlowsJobCounts`](#bulkstartflowsjobcounts)\n- [`BulkStartFlowsJob`](#bulkstartflowsjob)\n- [`BulkStartFlowsJobSummary`](#bulkstartflowsjobsummary)\n- [`ListBulkStartFlowsJobsResp`](#listbulkstartflowsjobsresp)\n- [`ActiveBulkStartFlowsJobResp`](#activebulkstartflowsjobresp)\n- [`PatchBulkStartFlowsJobReq`](#patchbulkstartflowsjobreq)\n- [`PortalWorkflowsBatchSearchReq`](#portalworkflowsbatchsearchreq)\n- [`PortalEntityRef`](#portalentityref)\n- [`PortalWorkflowsBatchSearchResp`](#portalworkflowsbatchsearchresp)\n- [`EntityPortalWorkflows`](#entityportalworkflows)\n- [`PortalWorkflow`](#portalworkflow)\n- [`PortalWorkflowTask`](#portalworkflowtask)\n- [`PortalWorkflowStage`](#portalworkflowstage)\n- [`PatchFlowReq`](#patchflowreq)\n- [`FlowExecution`](#flowexecution)\n- [`FlowClosingReason`](#flowclosingreason)\n- [`FlowTrigger`](#flowtrigger)\n- [`ConfiguredTrigger`](#configuredtrigger)\n- [`VisibleEntity`](#visibleentity)\n- [`FlowContext`](#flowcontext)\n- [`EntityRef`](#entityref)\n- [`PhaseId`](#phaseid)\n- [`TaskId`](#taskid)\n- [`Task`](#task)\n- [`TaskType`](#tasktype)\n- [`ManualTask`](#manualtask)\n- [`AutomationTask`](#automationtask)\n- [`AutomationFailurePolicy`](#automationfailurepolicy)\n- [`LoopInfo`](#loopinfo)\n- [`LoopExecutionState`](#loopexecutionstate)\n- [`LoopMembership`](#loopmembership)\n- [`LoopOutcome`](#loopoutcome)\n- [`LoopConfig`](#loopconfig)\n- [`TriggerMode`](#triggermode)\n- [`ActionSchedule`](#actionschedule)\n- [`ImmediateSchedule`](#immediateschedule)\n- [`DelayedSchedule`](#delayedschedule)\n- [`RelativeSchedule`](#relativeschedule)\n- [`DecisionTask`](#decisiontask)\n- [`AiAgentTask`](#aiagenttask)\n- [`AgentConfig`](#agentconfig)\n- [`AgentExecutionInfo`](#agentexecutioninfo)\n- [`TaskAudience`](#taskaudience)\n- [`TaskBase`](#taskbase)\n- [`Stage`](#stage)\n- [`Phase`](#phase)\n- [`Edge`](#edge)\n- [`AutomationInfo`](#automationinfo)\n- [`JourneyExecutionInfo`](#journeyexecutioninfo)\n- [`AutomationInputContext`](#automationinputcontext)\n- [`AutomationInputExtraContextRef`](#automationinputextracontextref)\n- [`AutomationInputExtraTaskRef`](#automationinputextrataskref)\n- [`AutomationOutputContext`](#automationoutputcontext)\n- [`AnalyticsInfo`](#analyticsinfo)\n- [`ConditionResult`](#conditionresult)\n- [`TaskIteration`](#taskiteration)\n- [`ConditionId`](#conditionid)\n- [`Condition`](#condition)\n- [`Statement`](#statement)\n- [`EvaluationSource`](#evaluationsource)\n- [`Operator`](#operator)\n- [`DueDateConfig`](#duedateconfig)\n- [`StartDateConfig`](#startdateconfig)\n- [`TimeUnit`](#timeunit)\n- [`EnableRequirement`](#enablerequirement)\n- [`Subtask`](#subtask)\n- [`SubtaskState`](#subtaskstate)\n- [`FlowTemplateId`](#flowtemplateid)\n- [`FlowExecutionId`](#flowexecutionid)\n- [`UserId`](#userid)\n- [`EcpPlaceholderAssignees`](#ecpplaceholderassignees)\n- [`VariableAssignment`](#variableassignment)\n- [`Assignees`](#assignees)\n- [`RunTaskAutomationReq`](#runtaskautomationreq)\n- [`TaskAutomationActionInputs`](#taskautomationactioninputs)\n- [`CancelFlowExecutionInputs`](#cancelflowexecutioninputs)\n- [`TaskEmailPreview`](#taskemailpreview)\n- [`EmailReviewConfig`](#emailreviewconfig)\n- [`SendEmailInputs`](#sendemailinputs)\n- [`PatchTaskReq`](#patchtaskreq)\n- [`PatchPhaseReq`](#patchphasereq)\n- [`AddTaskReq`](#addtaskreq)\n\n### `getExecutions`\n\nRetrieve Workflow Executions. Optionally, you can filter them by context & schema. Please be aware, these executions are more light weight - steps are not loaded with all information.\n\n`GET /v1/workflows/executions`\n\n```ts\nconst { data } = await client.getExecutions({\n context: \'example\',\n schema: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n[\n {\n "id": "8gja72h6kas6h",\n "name": "Lead Qualification",\n "trigger": "MANUAL",\n "status": "STARTED",\n "creationTime": "2021-04-27T12:01:13.000Z",\n "lastUpdateTime": "2021-04-27T12:01:13.000Z",\n "dueDate": "2021-04-27T12:01:13.000Z",\n "flow": [\n {\n "id": "sectionId1",\n "definitionId": "section_definition_id_1",\n "name": "Initial Information Gathering",\n "type": "SECTION",\n "steps": [\n {\n "id": "sada5641f3a21",\n "definitionId": "step_definition_id_1",\n "name": "Call client"\n },\n {\n "id": "sada5641f3a22",\n "definitionId": "step_definition_id_2",\n "name": "Check product availability"\n }\n ]\n },\n {\n "id": "firstLevelStepId1",\n "definitionId": "step_definition_id_4",\n "name": "Print and send catalog",\n "type": "STEP"\n }\n ]\n }\n]\n```\n\n</details>\n\n---\n\n### `createExecution`\n\nCreates a new V1 Workflow Execution from a workflow definition (template).\n\n`POST /v1/workflows/executions`\n\n```ts\nconst { data } = await client.createExecution(\n null,\n {\n workflowId: \'j3f23fh23uif98\',\n trigger: \'AUTOMATIC\',\n contexts: [\n {\n id: \'3fa3fa86-0907-4642-a57e-0fe30a19874d\',\n schema: \'contact\'\n },\n {\n id: \'3a6d42fa-5070-4723-b90f-41ead4303e33\',\n schema: \'opportunity\'\n }\n ]\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "8gja72h6kas6h",\n "name": "Lead Qualification",\n "trigger": "MANUAL",\n "status": "STARTED",\n "creationTime": "2021-04-27T12:01:13.000Z",\n "lastUpdateTime": "2021-04-27T12:01:13.000Z",\n "dueDate": "2021-04-27T12:01:13.000Z",\n "assignedTo": ["252", "29052"],\n "flow": [\n {\n "id": "sectionId1",\n "name": "Initial Information Gathering",\n "steps": [\n {\n "id": "sada5641f3a21",\n "name": "Call client and confirm address and product",\n "definitionId": "step_definition_id_1",\n "status": "ASSIGNED",\n "assignedTo": ["11"]\n },\n {\n "id": "sada5641f3a22",\n "name": "Check product availability",\n "status": "UNASSIGNED",\n "definitionId": "step_definition_id_2"\n }\n ]\n },\n {\n "id": "firstLevelStepId1",\n "definitionId": "step_definition_id_4",\n "name": "Print and send catalog",\n "status": "SKIPPED",\n "dueDate": "2023-01-15T20:00:00"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `getExecution`\n\nRetrieves a complete V1 workflow execution by ID, including all steps information.\n\n`GET /v1/workflows/executions/{executionId}`\n\n```ts\nconst { data } = await client.getExecution({\n executionId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "8gja72h6kas6h",\n "name": "Lead Qualification",\n "trigger": "MANUAL",\n "status": "STARTED",\n "creationTime": "2021-04-27T12:01:13.000Z",\n "lastUpdateTime": "2021-04-27T12:01:13.000Z",\n "dueDate": "2021-04-27T12:01:13.000Z",\n "assignedTo": ["252", "29052"],\n "flow": [\n {\n "id": "sectionId1",\n "name": "Initial Information Gathering",\n "steps": [\n {\n "id": "sada5641f3a21",\n "name": "Call client and confirm address and product",\n "definitionId": "step_definition_id_1",\n "status": "ASSIGNED",\n "assignedTo": ["11"]\n },\n {\n "id": "sada5641f3a22",\n "name": "Check product availability",\n "status": "UNASSIGNED",\n "definitionId": "step_definition_id_2"\n }\n ]\n },\n {\n "id": "firstLevelStepId1",\n "definitionId": "step_definition_id_4",\n "name": "Print and send catalog",\n "status": "SKIPPED",\n "dueDate": "2023-01-15T20:00:00"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `updateExecution`\n\nPatches updates like assignees, status, closingReason for a single Workflow Execution.\n\n`PATCH /v1/workflows/executions/{executionId}`\n\n```ts\nconst { data } = await client.updateExecution(\n {\n executionId: \'example\',\n },\n {\n status: \'STARTED\',\n assignedTo: [\'string\'],\n selectedClosingReasons: [\n {\n id: \'string\',\n title: \'string\'\n }\n ],\n closingReasonDescription: \'string\',\n dueDate: \'string\',\n dynamicDueDate: {\n numberOfUnits: 0,\n timePeriod: \'minutes\',\n actionTypeCondition: \'WORKFLOW_STARTED\',\n stepId: \'string\',\n phaseId: \'string\'\n },\n closedBy: \'string\',\n contexts: [\n {\n id: \'string\',\n title: \'string\',\n schema: \'string\'\n }\n ],\n completedTime: \'string\'\n },\n)\n```\n\n---\n\n### `deleteExecution`\n\nDelete workflow execution by id. Workflow contexts will NOT be deleted.\n\n`DELETE /v1/workflows/executions/{executionId}`\n\n```ts\nconst { data } = await client.deleteExecution({\n executionId: \'example\',\n})\n```\n\n---\n\n### `createStep`\n\nCreate a new step in current workflow execution.\n\n`POST /v1/workflows/executions/{executionId}/steps`\n\n```ts\nconst { data } = await client.createStep(\n {\n executionId: \'example\',\n },\n {\n insertionIndex: 0,\n name: \'string\',\n description: {\n enabled: true,\n value: \'string\'\n },\n status: \'UNASSIGNED\',\n sectionId: \'string\',\n executionType: \'MANUAL\',\n automationConfig: {\n flowId: \'string\',\n executionId: \'string\',\n executionStatus: \'string\'\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "string",\n "definitionId": "string",\n "entityRefId": "string",\n "name": "string",\n "description": {\n "enabled": true,\n "value": "string"\n },\n "type": "STEP",\n "ecp": {\n "enabled": true,\n "label": "string",\n "description": "string",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [],\n "ai_prefill": {}\n }\n },\n "installer": {\n "enabled": true,\n "label": "string",\n "description": "string",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [],\n "ai_prefill": {}\n }\n },\n "partner": {\n "enabled": true,\n "label": "string",\n "description": "string"\n },\n "enabled": true,\n "requirements": [\n {\n "definitionId": "string",\n "type": "STEP",\n "condition": "CLOSED"\n }\n ],\n "executionType": "MANUAL",\n "sectionId": "string",\n "executionId": "string",\n "userIds": [0],\n "assignedTo": ["string"],\n "assignedToInProgress": "string",\n "assignedToOnHold": "string",\n "status": "UNASSIGNED",\n "created": "string",\n "lastUpdated": "string",\n "statusLastUpdated": "string",\n "startedTime": "string",\n "completedTime": "string",\n "dueDate": "string",\n "dynamicDueDate": {\n "numberOfUnits": 0,\n "timePeriod": "minutes",\n "actionTypeCondition": "WORKFLOW_STARTED",\n "stepId": "string",\n "phaseId": "string"\n },\n "manuallyCreated": true,\n "automationConfig": {\n "flowId": "string",\n "executionId": "string",\n "executionStatus": "string"\n },\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [\n {}\n ],\n "ai_prefill": {\n "enabled": false,\n "source": {},\n "extraction_fields": [],\n "mappings": [],\n "min_confidence": 0.8,\n "instructions": "string"\n }\n },\n "taxonomies": ["string"]\n}\n```\n\n</details>\n\n---\n\n### `updateStep`\n\nUpdates a workflow execution step with new values for status, assignees, due date, position, and more.\n\n`PATCH /v1/workflows/executions/{executionId}/steps/{stepId}`\n\n```ts\nconst { data } = await client.updateStep(\n {\n executionId: \'example\',\n stepId: \'example\',\n },\n {\n stepId: \'string\',\n entityRefId: \'string\',\n userIds: [0],\n assignedTo: [\'string\'],\n assignedToInProgress: \'string\',\n assignedToOnHold: \'string\',\n status: \'UNASSIGNED\',\n dueDate: \'string\',\n dynamicDueDate: {\n numberOfUnits: 0,\n timePeriod: \'minutes\',\n actionTypeCondition: \'WORKFLOW_STARTED\',\n stepId: \'string\',\n phaseId: \'string\'\n },\n name: \'string\',\n description: {\n enabled: true,\n value: \'string\'\n },\n position: {\n index: 0,\n sectionId: \'string\'\n },\n automationConfig: {\n flowId: \'string\',\n executionId: \'string\',\n executionStatus: \'string\'\n },\n journey: {\n id: \'string\',\n journeyId: \'string\',\n name: \'string\',\n portal_button_label: \'string\',\n complete_task_automatically: true,\n journey_submission_required: true,\n context_parameters: [\n {\n key: \'string\',\n value: \'string\'\n }\n ],\n ai_prefill: {\n enabled: false,\n source: {\n type: \'flow_context\',\n input_entity: \'last_email\'\n },\n extraction_fields: [\n {\n key: \'string\',\n type: \'string\',\n description: \'string\',\n description_overridden: true,\n enum: [\'string\']\n }\n ],\n mappings: [\n {\n source: \'string\',\n block_id: \'string\',\n block_type: \'text-input\',\n block_field: \'string\'\n }\n ],\n min_confidence: 0.8,\n instructions: \'string\'\n }\n },\n startedTime: \'string\',\n completedTime: \'string\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "string",\n "definitionId": "string",\n "entityRefId": "string",\n "name": "string",\n "description": {\n "enabled": true,\n "value": "string"\n },\n "type": "STEP",\n "ecp": {\n "enabled": true,\n "label": "string",\n "description": "string",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [],\n "ai_prefill": {}\n }\n },\n "installer": {\n "enabled": true,\n "label": "string",\n "description": "string",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [],\n "ai_prefill": {}\n }\n },\n "partner": {\n "enabled": true,\n "label": "string",\n "description": "string"\n },\n "enabled": true,\n "requirements": [\n {\n "definitionId": "string",\n "type": "STEP",\n "condition": "CLOSED"\n }\n ],\n "executionType": "MANUAL",\n "sectionId": "string",\n "executionId": "string",\n "userIds": [0],\n "assignedTo": ["string"],\n "assignedToInProgress": "string",\n "assignedToOnHold": "string",\n "status": "UNASSIGNED",\n "created": "string",\n "lastUpdated": "string",\n "statusLastUpdated": "string",\n "startedTime": "string",\n "completedTime": "string",\n "dueDate": "string",\n "dynamicDueDate": {\n "numberOfUnits": 0,\n "timePeriod": "minutes",\n "actionTypeCondition": "WORKFLOW_STARTED",\n "stepId": "string",\n "phaseId": "string"\n },\n "manuallyCreated": true,\n "automationConfig": {\n "flowId": "string",\n "executionId": "string",\n "executionStatus": "string"\n },\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [\n {}\n ],\n "ai_prefill": {\n "enabled": false,\n "source": {},\n "extraction_fields": [],\n "mappings": [],\n "min_confidence": 0.8,\n "instructions": "string"\n }\n },\n "taxonomies": ["string"]\n}\n```\n\n</details>\n\n---\n\n### `deleteStep`\n\nDeletes a step from a workflow execution.\n\n`DELETE /v1/workflows/executions/{executionId}/steps/{stepId}`\n\n```ts\nconst { data } = await client.deleteStep({\n executionId: \'example\',\n stepId: \'example\',\n})\n```\n\n---\n\n### `getClosingReasonExecution`\n\nShows all Closing Reasons defined at the moment of starting the Workflow Execution.\nThe Closing Reasons shown in the execution are just snapshots\nfrom the state of the Definition when the instance was\n\n`GET /v1/workflows/executions/{executionId}/closing-reasons`\n\n```ts\nconst { data } = await client.getClosingReasonExecution({\n executionId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "reasons": [\n {\n "id": "string",\n "title": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `startFlowExecution`\n\nStarts a new Flow Execution based on a flow template (definition).\n\n`POST /v2/flows/executions`\n\n```ts\nconst { data } = await client.startFlowExecution(\n null,\n {\n flow_template_id: \'tpl_abc123def456\',\n trigger: {\n type: \'MANUAL\',\n automation_config: {\n flow_id: \'string\',\n execution_id: \'string\',\n execution_status: \'string\',\n error_reason: \'string\',\n input_context: {\n source: \'main_context\',\n task_id: \'string\',\n trigger_id: \'string\',\n with_relations: true,\n also_pass: [\n {\n source: \'main_context\'\n }\n ]\n },\n output_context: {\n set_as_primary: true,\n attach_to_contexts: true\n },\n heal_attempts: 0,\n run_for_user_id: \'string\',\n last_heal_attempted_at: \'1970-01-01T00:00:00.000Z\',\n wait_for_journey_submission: true,\n journey_id: \'string\',\n journey_execution: {\n execution_id: \'string\',\n execution_status: \'string\',\n error_reason: \'string\',\n submission_entity_id: \'string\',\n submission_created_at: \'1970-01-01T00:00:00.000Z\',\n wait_overridden_at: \'1970-01-01T00:00:00.000Z\',\n wait_overridden_by: \'string\'\n },\n eligible_closing_reason_ids: [\'string\'],\n allow_execution_note: true,\n email_review: {\n enabled: true,\n allow_document_selection: true,\n allow_subject_and_body_edit: true\n }\n },\n trigger_id: \'string\'\n },\n contexts: [\n {\n entity_id: \'string\',\n entity_schema: \'string\',\n is_primary: false,\n promoted_by_task_id: \'string\',\n promoted_at: \'1970-01-01T00:00:00.000Z\',\n demoted_by_task_id: \'string\',\n added_by_task_id: \'string\'\n }\n ],\n purposes: [\'string\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "string",\n "loop_source": "loops",\n "flow_template_id": "string",\n "org_id": "string",\n "name": "string",\n "created_at": "string",\n "updated_at": "string",\n "due_date": "string",\n "due_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string",\n "phase_id": "string"\n },\n "status": "STARTED",\n "assigned_to": ["string"],\n "analytics": {\n "started_at": "string",\n "completed_at": "string",\n "closed_at": "string",\n "started_by": "string",\n "started_by_org_id": "string",\n "closed_by": "string",\n "completed_by": "string"\n },\n "contexts": [\n {\n "entity_id": "string",\n "entity_schema": "string",\n "is_primary": false,\n "promoted_by_task_id": "string",\n "promoted_at": "1970-01-01T00:00:00.000Z",\n "demoted_by_task_id": "string",\n "added_by_task_id": "string"\n }\n ],\n "visibility": "entity_views",\n "visible_on": [\n {\n "entity_id": "string",\n "entity_schema": "string",\n "kind": "context",\n "anchor_entity_id": "string",\n "rule_id": "string"\n }\n ],\n "crt_tasks": [\n {\n "id": "string",\n "crt_since": "1970-01-01T00:00:00.000Z"\n }\n ],\n "phases": [\n {\n "id": "string",\n "template_id": "string",\n "name": "string",\n "status": "OPEN",\n "updated_at": "string",\n "due_date": "2021-04-27T12:00:00.000Z",\n "due_date_config": {},\n "assigned_to": ["string"],\n "analytics": {},\n "taxonomies": ["string"],\n "loop_config": {},\n "loop_membership": []\n }\n ],\n "stages": [\n {\n "id": "string",\n "name": "string",\n "description": "string",\n "entry_node_id": "string",\n "cut_edge_ids": ["string"],\n "color": "string",\n "portal_names": {},\n "portal_descriptions": {}\n }\n ],\n "portal_titles": {\n "ecp": "string",\n "installer": "string"\n },\n "tasks": [\n {\n "id": "string",\n "loop_membership": [],\n "template_id": "string",\n "name": "string",\n "description": {},\n "status": "UNASSIGNED",\n "journey": {},\n "journey_prefill": {},\n "due_date": "2021-04-27T12:00:00.000Z",\n "due_date_config": {},\n "start_date": "2021-04-27T12:00:00.000Z",\n "start_date_config": {},\n "requirements": [],\n "required": true,\n "subtasks": [],\n "subtask_states": {},\n "journey_submission": {},\n "completion_gates_reset_at": "1970-01-01T00:00:00.000Z",\n "journey_gate_waived_at": "1970-01-01T00:00:00.000Z",\n "assigned_to": ["string"],\n "ecp_placeholder_assignees": {},\n "analytics": {},\n "loop_iterations": {},\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z",\n "manually_created": true,\n "enabled": true,\n "ecp": {},\n "installer": {},\n "partner": {},\n "audience_order": ["description"],\n "taxonomies": ["string"],\n "phase_id": "string",\n "task_type": "MANUAL",\n "loop_config": {}\n }\n ],\n "edges": [\n {\n "id": "string",\n "from_id": "string",\n "to_id": "string",\n "condition_id": "abc123",\n "none_met": true,\n "loop_id": "string"\n }\n ],\n "_execution_chain": {\n "parent_execution_id": "string",\n "parent_task_id": "string",\n "depth": 0\n },\n "_automation_chain": ["string"],\n "closing_reason": {\n "selected_reasons": [\n {}\n ],\n "configured_reasons": [\n {}\n ],\n "extra_description": "string"\n },\n "available_in_ecp": true,\n "entity_sync": [\n {\n "trigger": {},\n "target": {},\n "value": {}\n }\n ],\n "taxonomies": ["string"],\n "trigger": {\n "type": "MANUAL",\n "automation_config": {\n "flow_id": "string",\n "execution_id": "string",\n "execution_status": "string",\n "error_reason": "string",\n "input_context": {},\n "output_context": {},\n "heal_attempts": 0,\n "run_for_user_id": "string",\n "last_heal_attempted_at": "1970-01-01T00:00:00.000Z",\n "wait_for_journey_submission": true,\n "journey_id": "string",\n "journey_execution": {},\n "eligible_closing_reason_ids": ["string"],\n "allow_execution_note": true,\n "email_review": {}\n },\n "trigger_id": "string"\n },\n "configured_triggers": [\n {\n "id": "string",\n "type": "string",\n "primary": true,\n "entity_schema": "string",\n "automation_id": "string",\n "journey_id": "string"\n }\n ],\n "singleClosingReasonSelection": true,\n "linear": true\n}\n```\n\n</details>\n\n---\n\n### `getFlowExecution`\n\nRetrieves a complete flow execution by ID, including all phases, tasks, edges, contexts, and analytics.\n\n`GET /v2/flows/executions/{execution_id}`\n\n```ts\nconst { data } = await client.getFlowExecution({\n execution_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "string",\n "loop_source": "loops",\n "flow_template_id": "string",\n "org_id": "string",\n "name": "string",\n "created_at": "string",\n "updated_at": "string",\n "due_date": "string",\n "due_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string",\n "phase_id": "string"\n },\n "status": "STARTED",\n "assigned_to": ["string"],\n "analytics": {\n "started_at": "string",\n "completed_at": "string",\n "closed_at": "string",\n "started_by": "string",\n "started_by_org_id": "string",\n "closed_by": "string",\n "completed_by": "string"\n },\n "contexts": [\n {\n "entity_id": "string",\n "entity_schema": "string",\n "is_primary": false,\n "promoted_by_task_id": "string",\n "promoted_at": "1970-01-01T00:00:00.000Z",\n "demoted_by_task_id": "string",\n "added_by_task_id": "string"\n }\n ],\n "visibility": "entity_views",\n "visible_on": [\n {\n "entity_id": "string",\n "entity_schema": "string",\n "kind": "context",\n "anchor_entity_id": "string",\n "rule_id": "string"\n }\n ],\n "crt_tasks": [\n {\n "id": "string",\n "crt_since": "1970-01-01T00:00:00.000Z"\n }\n ],\n "phases": [\n {\n "id": "string",\n "template_id": "string",\n "name": "string",\n "status": "OPEN",\n "updated_at": "string",\n "due_date": "2021-04-27T12:00:00.000Z",\n "due_date_config": {},\n "assigned_to": ["string"],\n "analytics": {},\n "taxonomies": ["string"],\n "loop_config": {},\n "loop_membership": []\n }\n ],\n "stages": [\n {\n "id": "string",\n "name": "string",\n "description": "string",\n "entry_node_id": "string",\n "cut_edge_ids": ["string"],\n "color": "string",\n "portal_names": {},\n "portal_descriptions": {}\n }\n ],\n "portal_titles": {\n "ecp": "string",\n "installer": "string"\n },\n "tasks": [\n {\n "id": "string",\n "loop_membership": [],\n "template_id": "string",\n "name": "string",\n "description": {},\n "status": "UNASSIGNED",\n "journey": {},\n "journey_prefill": {},\n "due_date": "2021-04-27T12:00:00.000Z",\n "due_date_config": {},\n "start_date": "2021-04-27T12:00:00.000Z",\n "start_date_config": {},\n "requirements": [],\n "required": true,\n "subtasks": [],\n "subtask_states": {},\n "journey_submission": {},\n "completion_gates_reset_at": "1970-01-01T00:00:00.000Z",\n "journey_gate_waived_at": "1970-01-01T00:00:00.000Z",\n "assigned_to": ["string"],\n "ecp_placeholder_assignees": {},\n "analytics": {},\n "loop_iterations": {},\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z",\n "manually_created": true,\n "enabled": true,\n "ecp": {},\n "installer": {},\n "partner": {},\n "audience_order": ["description"],\n "taxonomies": ["string"],\n "phase_id": "string",\n "task_type": "MANUAL",\n "loop_config": {}\n }\n ],\n "edges": [\n {\n "id": "string",\n "from_id": "string",\n "to_id": "string",\n "condition_id": "abc123",\n "none_met": true,\n "loop_id": "string"\n }\n ],\n "_execution_chain": {\n "parent_execution_id": "string",\n "parent_task_id": "string",\n "depth": 0\n },\n "_automation_chain": ["string"],\n "closing_reason": {\n "selected_reasons": [\n {}\n ],\n "configured_reasons": [\n {}\n ],\n "extra_description": "string"\n },\n "available_in_ecp": true,\n "entity_sync": [\n {\n "trigger": {},\n "target": {},\n "value": {}\n }\n ],\n "taxonomies": ["string"],\n "trigger": {\n "type": "MANUAL",\n "automation_config": {\n "flow_id": "string",\n "execution_id": "string",\n "execution_status": "string",\n "error_reason": "string",\n "input_context": {},\n "output_context": {},\n "heal_attempts": 0,\n "run_for_user_id": "string",\n "last_heal_attempted_at": "1970-01-01T00:00:00.000Z",\n "wait_for_journey_submission": true,\n "journey_id": "string",\n "journey_execution": {},\n "eligible_closing_reason_ids": ["string"],\n "allow_execution_note": true,\n "email_review": {}\n },\n "trigger_id": "string"\n },\n "configured_triggers": [\n {\n "id": "string",\n "type": "string",\n "primary": true,\n "entity_schema": "string",\n "automation_id": "string",\n "journey_id": "string"\n }\n ],\n "singleClosingReasonSelection": true,\n "linear": true\n}\n```\n\n</details>\n\n---\n\n### `patchFlowExecution`\n\nPatch flow execution with new assignees, status, analytics & other changes.\n\n`PATCH /v2/flows/executions/{execution_id}`\n\n```ts\nconst { data } = await client.patchFlowExecution(\n {\n execution_id: \'example\',\n },\n {\n status: \'STARTED\',\n assigned_to: [\'string\'],\n closing_reason: {\n selected_reasons: [\n {\n id: \'string\',\n title: \'string\'\n }\n ],\n configured_reasons: [\n {\n id: \'string\',\n title: \'string\'\n }\n ],\n extra_description: \'string\'\n },\n due_date: \'string\',\n due_date_config: {\n duration: 0,\n unit: \'minutes\',\n type: \'WORKFLOW_STARTED\',\n task_id: \'string\',\n phase_id: \'string\'\n },\n contexts: [\n {\n entity_id: \'string\',\n entity_schema: \'string\',\n is_primary: false,\n promoted_by_task_id: \'string\',\n promoted_at: \'1970-01-01T00:00:00.000Z\',\n demoted_by_task_id: \'string\',\n added_by_task_id: \'string\'\n }\n ],\n visibility: \'entity_views\',\n visible_on: [\n {\n entity_id: \'string\',\n entity_schema: \'string\',\n kind: \'context\',\n anchor_entity_id: \'string\',\n rule_id: \'string\'\n }\n ]\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "string",\n "loop_source": "loops",\n "flow_template_id": "string",\n "org_id": "string",\n "name": "string",\n "created_at": "string",\n "updated_at": "string",\n "due_date": "string",\n "due_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string",\n "phase_id": "string"\n },\n "status": "STARTED",\n "assigned_to": ["string"],\n "analytics": {\n "started_at": "string",\n "completed_at": "string",\n "closed_at": "string",\n "started_by": "string",\n "started_by_org_id": "string",\n "closed_by": "string",\n "completed_by": "string"\n },\n "contexts": [\n {\n "entity_id": "string",\n "entity_schema": "string",\n "is_primary": false,\n "promoted_by_task_id": "string",\n "promoted_at": "1970-01-01T00:00:00.000Z",\n "demoted_by_task_id": "string",\n "added_by_task_id": "string"\n }\n ],\n "visibility": "entity_views",\n "visible_on": [\n {\n "entity_id": "string",\n "entity_schema": "string",\n "kind": "context",\n "anchor_entity_id": "string",\n "rule_id": "string"\n }\n ],\n "crt_tasks": [\n {\n "id": "string",\n "crt_since": "1970-01-01T00:00:00.000Z"\n }\n ],\n "phases": [\n {\n "id": "string",\n "template_id": "string",\n "name": "string",\n "status": "OPEN",\n "updated_at": "string",\n "due_date": "2021-04-27T12:00:00.000Z",\n "due_date_config": {},\n "assigned_to": ["string"],\n "analytics": {},\n "taxonomies": ["string"],\n "loop_config": {},\n "loop_membership": []\n }\n ],\n "stages": [\n {\n "id": "string",\n "name": "string",\n "description": "string",\n "entry_node_id": "string",\n "cut_edge_ids": ["string"],\n "color": "string",\n "portal_names": {},\n "portal_descriptions": {}\n }\n ],\n "portal_titles": {\n "ecp": "string",\n "installer": "string"\n },\n "tasks": [\n {\n "id": "string",\n "loop_membership": [],\n "template_id": "string",\n "name": "string",\n "description": {},\n "status": "UNASSIGNED",\n "journey": {},\n "journey_prefill": {},\n "due_date": "2021-04-27T12:00:00.000Z",\n "due_date_config": {},\n "start_date": "2021-04-27T12:00:00.000Z",\n "start_date_config": {},\n "requirements": [],\n "required": true,\n "subtasks": [],\n "subtask_states": {},\n "journey_submission": {},\n "completion_gates_reset_at": "1970-01-01T00:00:00.000Z",\n "journey_gate_waived_at": "1970-01-01T00:00:00.000Z",\n "assigned_to": ["string"],\n "ecp_placeholder_assignees": {},\n "analytics": {},\n "loop_iterations": {},\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z",\n "manually_created": true,\n "enabled": true,\n "ecp": {},\n "installer": {},\n "partner": {},\n "audience_order": ["description"],\n "taxonomies": ["string"],\n "phase_id": "string",\n "task_type": "MANUAL",\n "loop_config": {}\n }\n ],\n "edges": [\n {\n "id": "string",\n "from_id": "string",\n "to_id": "string",\n "condition_id": "abc123",\n "none_met": true,\n "loop_id": "string"\n }\n ],\n "_execution_chain": {\n "parent_execution_id": "string",\n "parent_task_id": "string",\n "depth": 0\n },\n "_automation_chain": ["string"],\n "closing_reason": {\n "selected_reasons": [\n {}\n ],\n "configured_reasons": [\n {}\n ],\n "extra_description": "string"\n },\n "available_in_ecp": true,\n "entity_sync": [\n {\n "trigger": {},\n "target": {},\n "value": {}\n }\n ],\n "taxonomies": ["string"],\n "trigger": {\n "type": "MANUAL",\n "automation_config": {\n "flow_id": "string",\n "execution_id": "string",\n "execution_status": "string",\n "error_reason": "string",\n "input_context": {},\n "output_context": {},\n "heal_attempts": 0,\n "run_for_user_id": "string",\n "last_heal_attempted_at": "1970-01-01T00:00:00.000Z",\n "wait_for_journey_submission": true,\n "journey_id": "string",\n "journey_execution": {},\n "eligible_closing_reason_ids": ["string"],\n "allow_execution_note": true,\n "email_review": {}\n },\n "trigger_id": "string"\n },\n "configured_triggers": [\n {\n "id": "string",\n "type": "string",\n "primary": true,\n "entity_schema": "string",\n "automation_id": "string",\n "journey_id": "string"\n }\n ],\n "singleClosingReasonSelection": true,\n "linear": true\n}\n```\n\n</details>\n\n---\n\n### `deleteFlowExecution`\n\nDeletes a specific execution of a flow, identified by id. Flow contexts will NOT be deleted.\n\n`DELETE /v2/flows/executions/{execution_id}`\n\n```ts\nconst { data } = await client.deleteFlowExecution({\n execution_id: \'example\',\n soft: true,\n})\n```\n\n---\n\n### `searchFlowExecutions`\n\nSearch Flow Executions for a specific Entity.\n\n`POST /v2/flows/executions:search`\n\n```ts\nconst { data } = await client.searchFlowExecutions(\n null,\n {\n entity_id: \'string\',\n entity_schema: \'string\',\n include_background: false\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "id": "string",\n "loop_source": "loops",\n "flow_template_id": "string",\n "org_id": "string",\n "name": "string",\n "created_at": "string",\n "updated_at": "string",\n "due_date": "string",\n "due_date_config": {},\n "status": "STARTED",\n "assigned_to": ["string"],\n "analytics": {},\n "contexts": [],\n "visibility": "entity_views",\n "visible_on": [],\n "crt_tasks": [],\n "phases": [],\n "stages": [],\n "portal_titles": {},\n "tasks": [],\n "edges": [],\n "_execution_chain": {},\n "_automation_chain": ["string"],\n "closing_reason": {},\n "available_in_ecp": true,\n "entity_sync": [],\n "taxonomies": ["string"],\n "trigger": {},\n "configured_triggers": [],\n "singleClosingReasonSelection": true,\n "linear": true\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `searchPortalWorkflows`\n\nReturns all portal-relevant workflow executions for a given entity, linearized into a\nflat, ordered list of portal-visible steps. Intended to be called by the Customer Portal\nAPI (ECP / Installer Port\n\n`POST /v2/flows/executions:portal-search`\n\n```ts\nconst { data } = await client.searchPortalWorkflows(\n null,\n {\n entity_id: \'string\',\n entity_schema: \'order\',\n audience: \'ecp\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "workflows": [\n {\n "id": "string",\n "definition_id": "string",\n "name": "string",\n "status": "STARTED",\n "version": 2,\n "created_at": "string",\n "updated_at": "string",\n "completed_at": "string",\n "due_date": "string",\n "assigned_to": ["string"],\n "contexts": [],\n "is_path_complete": true,\n "tasks": [],\n "stages": [],\n "portal_titles": {}\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `searchPortalWorkflowsBatch`\n\nBatch variant of `searchPortalWorkflows`: returns portal-relevant workflow\nexecutions for MANY entities in a single call \u2014 schemas may differ \u2014 each\nlinearized into a flat, ordered list of portal-visi\n\n`POST /v2/flows/executions:portal-search-batch`\n\n```ts\nconst { data } = await client.searchPortalWorkflowsBatch(\n null,\n {\n entities: [\n {\n entity_id: \'string\',\n entity_schema: \'order\'\n }\n ],\n audience: \'ecp\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "entity_id": "string",\n "workflows": []\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `bulkStartFlows`\n\nCreates a job that starts one or more flows on many entities: every flow in\n`flow_template_ids` is started on every entity in `entities` (up to 5 flows,\n200 entities, 1000 starts). Every start is manu\n\n`POST /v2/flows/executions:bulk-start`\n\n```ts\nconst { data } = await client.bulkStartFlows(\n null,\n {\n flow_template_ids: [\'string\'],\n entities: [\n {\n entity_id: \'string\',\n entity_schema: \'opportunity\'\n }\n ],\n purposes: [\'string\']\n },\n)\n```\n\n---\n\n### `listBulkStartFlowsJobs`\n\nLists the organization\'s approved bulk-start jobs, newest approval first,\nwith their counts but without items. Jobs never approved (still awaiting\napproval, or expired) are not listed. Jobs are kept f\n\n`GET /v2/flows/bulk-jobs`\n\n```ts\nconst { data } = await client.listBulkStartFlowsJobs({\n size: 1,\n cursor: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "job_id": "string",\n "org_id": "string",\n "status": "awaiting_approval",\n "created_by": "string",\n "created_by_org_id": "string",\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z",\n "expires_at": "1970-01-01T00:00:00.000Z",\n "approved_at": "1970-01-01T00:00:00.000Z",\n "approved_by": "string",\n "finished_at": "1970-01-01T00:00:00.000Z",\n "cancel_requested": true,\n "restart_of": "string",\n "restarted_by": "string",\n "flows": [\n {\n "flow_template_id": "string",\n "flow_name": "string",\n "will_start": 0,\n "skipped": 0\n }\n ],\n "entity_schema": "string",\n "entity_ids": ["string"],\n "entity_count": 0,\n "counts": {\n "total": 0,\n "pending": 0,\n "started": 0,\n "failed": 0,\n "skipped": 0,\n "cancelled": 0\n }\n }\n ],\n "next_cursor": "string"\n}\n```\n\n</details>\n\n---\n\n### `getActiveBulkStartFlowsJob`\n\nReturns the caller\'s bulk-start job in flight (`queued` or `running`), or\n`job: null` when there is none.\n\n`GET /v2/flows/bulk-jobs:active`\n\n```ts\nconst { data } = await client.getActiveBulkStartFlowsJob()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "job": {\n "job_id": "string",\n "org_id": "string",\n "status": "awaiting_approval",\n "created_by": "string",\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z",\n "expires_at": "1970-01-01T00:00:00.000Z",\n "approved_at": "1970-01-01T00:00:00.000Z",\n "approved_by": "string",\n "finished_at": "1970-01-01T00:00:00.000Z",\n "cancel_requested": true,\n "restart_of": "string",\n "restarted_by": "string",\n "flows": [\n {\n "flow_template_id": "string",\n "flow_name": "string",\n "will_start": 0,\n "skipped": 0\n }\n ],\n "counts": {\n "total": 0,\n "pending": 0,\n "started": 0,\n "failed": 0,\n "skipped": 0,\n "cancelled": 0\n },\n "items": [\n {\n "flow_template_id": "string",\n "entity_id": "string",\n "entity_schema": "string",\n "status": "pending",\n "execution_id": "string",\n "error_code": "string",\n "error_message": "string",\n "updated_at": "1970-01-01T00:00:00.000Z"\n }\n ]\n }\n}\n```\n\n</details>\n\n---\n\n### `getBulkStartFlowsJob`\n\nReturns a bulk-start job with its counts and one item per (flow, entity)\npair, including the started execution id or the error.\n\n`GET /v2/flows/bulk-jobs/{job_id}`\n\n```ts\nconst { data } = await client.getBulkStartFlowsJob({\n job_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "job_id": "string",\n "org_id": "string",\n "status": "awaiting_approval",\n "created_by": "string",\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z",\n "expires_at": "1970-01-01T00:00:00.000Z",\n "approved_at": "1970-01-01T00:00:00.000Z",\n "approved_by": "string",\n "finished_at": "1970-01-01T00:00:00.000Z",\n "cancel_requested": true,\n "restart_of": "string",\n "restarted_by": "string",\n "flows": [\n {\n "flow_template_id": "string",\n "flow_name": "string",\n "will_start": 0,\n "skipped": 0\n }\n ],\n "counts": {\n "total": 0,\n "pending": 0,\n "started": 0,\n "failed": 0,\n "skipped": 0,\n "cancelled": 0\n },\n "items": [\n {\n "flow_template_id": "string",\n "entity_id": "string",\n "entity_schema": "string",\n "status": "pending",\n "execution_id": "string",\n "error_code": "string",\n "error_message": "string",\n "updated_at": "1970-01-01T00:00:00.000Z"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `patchBulkStartFlowsJob`\n\nApproves or cancels a bulk-start job.\n\n`PATCH /v2/flows/bulk-jobs/{job_id}`\n\n```ts\nconst { data } = await client.patchBulkStartFlowsJob(\n {\n job_id: \'example\',\n },\n {\n action: \'APPROVE\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "job_id": "string",\n "org_id": "string",\n "status": "awaiting_approval",\n "created_by": "string",\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z",\n "expires_at": "1970-01-01T00:00:00.000Z",\n "approved_at": "1970-01-01T00:00:00.000Z",\n "approved_by": "string",\n "finished_at": "1970-01-01T00:00:00.000Z",\n "cancel_requested": true,\n "restart_of": "string",\n "restarted_by": "string",\n "flows": [\n {\n "flow_template_id": "string",\n "flow_name": "string",\n "will_start": 0,\n "skipped": 0\n }\n ],\n "counts": {\n "total": 0,\n "pending": 0,\n "started": 0,\n "failed": 0,\n "skipped": 0,\n "cancelled": 0\n },\n "items": [\n {\n "flow_template_id": "string",\n "entity_id": "string",\n "entity_schema": "string",\n "status": "pending",\n "execution_id": "string",\n "error_code": "string",\n "error_message": "string",\n "updated_at": "1970-01-01T00:00:00.000Z"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `restartBulkStartFlowsJob`\n\nRestarts what is left of an ended bulk-start job: creates a new job, in\n`awaiting_approval`, from the job\'s `failed` items and the items it never\nstarted (`cancelled`). Started and skipped items are n\n\n`POST /v2/flows/bulk-jobs/{job_id}/restart`\n\n```ts\nconst { data } = await client.restartBulkStartFlowsJob({\n job_id: \'example\',\n})\n```\n\n---\n\n### `patchTask`\n\nUpdates attributes of a flow task including status, assignees, due date, and more.\n\n`PATCH /v2/flows/executions/{execution_id}/tasks/{task_id}`\n\n```ts\nconst { data } = await client.patchTask(\n {\n execution_id: \'example\',\n task_id: \'example\',\n },\n {\n name: \'Review customer application\',\n status: \'UNASSIGNED\',\n due_date: \'2026-05-28T00:00:00.000\',\n due_date_config: {\n duration: 0,\n unit: \'minutes\',\n type: \'WORKFLOW_STARTED\',\n task_id: \'string\',\n phase_id: \'string\'\n },\n assigned_to: [\'string\'],\n enabled: true,\n automation_config: {\n flow_id: \'string\',\n execution_id: \'string\',\n execution_status: \'string\',\n error_reason: \'string\',\n input_context: {\n source: \'main_context\',\n task_id: \'string\',\n trigger_id: \'string\',\n with_relations: true,\n also_pass: [ /* ... */ ]\n },\n output_context: {\n set_as_primary: true,\n attach_to_contexts: true\n },\n heal_attempts: 0,\n run_for_user_id: \'string\',\n last_heal_attempted_at: \'1970-01-01T00:00:00.000Z\',\n wait_for_journey_submission: true,\n journey_id: \'string\',\n journey_execution: {\n execution_id: \'string\',\n execution_status: \'string\',\n error_reason: \'string\',\n submission_entity_id: \'string\',\n submission_created_at: \'1970-01-01T00:00:00.000Z\',\n wait_overridden_at: \'1970-01-01T00:00:00.000Z\',\n wait_overridden_by: \'string\'\n },\n eligible_closing_reason_ids: [\'string\'],\n allow_execution_note: true,\n email_review: {\n enabled: true,\n allow_document_selection: true,\n allow_subject_and_body_edit: true\n }\n },\n description: {\n enabled: true,\n value: \'string\'\n },\n ecp: {\n enabled: true,\n label: \'string\',\n description: \'string\',\n journey: {\n id: \'string\',\n journeyId: \'string\',\n name: \'string\',\n portal_button_label: \'string\',\n complete_task_automatically: true,\n journey_submission_required: true,\n context_parameters: [ /* ... */ ],\n ai_prefill: { /* ... */ }\n }\n },\n installer: {\n enabled: true,\n label: \'string\',\n description: \'string\',\n journey: {\n id: \'string\',\n journeyId: \'string\',\n name: \'string\',\n portal_button_label: \'string\',\n complete_task_automatically: true,\n journey_submission_required: true,\n context_parameters: [ /* ... */ ],\n ai_prefill: { /* ... */ }\n }\n },\n partner: {\n enabled: true,\n label: \'string\',\n description: \'string\'\n },\n subtask_states: {},\n next_condition_id: \'cond_branch_approved\',\n next_condition_ids: [\'cond_branch_a\', \'cond_branch_b\'],\n revert_execution: false,\n completed_via_journey: false,\n excluded_partner_org_ids: [\'partner-org-1\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "string",\n "loop_membership": [\n {\n "loop_id": "string",\n "runs_in_loop": true\n }\n ],\n "template_id": "string",\n "name": "string",\n "description": {\n "enabled": true,\n "value": "string"\n },\n "status": "UNASSIGNED",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [\n {}\n ],\n "ai_prefill": {\n "enabled": false,\n "source": {},\n "extraction_fields": [],\n "mappings": [],\n "min_confidence": 0.8,\n "instructions": "string"\n }\n },\n "journey_prefill": {\n "status": "PENDING",\n "agent_execution_id": "string",\n "dispatched_at": "1970-01-01T00:00:00.000Z",\n "extracted_at": "1970-01-01T00:00:00.000Z",\n "initial_state": {},\n "field_confidence": {},\n "dropped": [\n {}\n ]\n },\n "due_date": "2021-04-27T12:00:00.000Z",\n "due_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string",\n "phase_id": "string"\n },\n "start_date": "2021-04-27T12:00:00.000Z",\n "start_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string"\n },\n "requirements": [\n {\n "task_id": "string",\n "phase_id": "string",\n "when": "TASK_FINISHED"\n }\n ],\n "required": true,\n "subtasks": [\n {\n "id": "string",\n "name": "string",\n "party": "description",\n "required": true\n }\n ],\n "subtask_states": {},\n "journey_submission": {\n "submission_entity_id": "string",\n "submitted_at": "1970-01-01T00:00:00.000Z"\n },\n "completion_gates_reset_at": "1970-01-01T00:00:00.000Z",\n "journey_gate_waived_at": "1970-01-01T00:00:00.000Z",\n "assigned_to": ["string"],\n "ecp_placeholder_assignees": {\n "placeholder_ecp_customers": ["string"],\n "placeholder_ecp_installers": ["string"]\n },\n "analytics": {\n "started_at": "1970-01-01T00:00:00.000Z",\n "in_progress_at": "1970-01-01T00:00:00.000Z",\n "completed_at": "1970-01-01T00:00:00.000Z",\n "status_updated_at": "1970-01-01T00:00:00.000Z",\n "in_progress_by": "string",\n "completed_by": "string",\n "skipped_at": "1970-01-01T00:00:00.000Z",\n "skipped_by": "string",\n "on_hold_by": "string"\n },\n "loop_iterations": {},\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z",\n "manually_created": true,\n "enabled": true,\n "ecp": {\n "enabled": true,\n "label": "string",\n "description": "string",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [],\n "ai_prefill": {}\n }\n },\n "installer": {\n "enabled": true,\n "label": "string",\n "description": "string",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [],\n "ai_prefill": {}\n }\n },\n "partner": {\n "enabled": true,\n "label": "string",\n "description": "string"\n },\n "audience_order": ["description"],\n "taxonomies": ["string"],\n "phase_id": "string",\n "task_type": "MANUAL",\n "loop_config": {\n "max_iterations": 3,\n "crt_iterations": 0\n }\n}\n```\n\n</details>\n\n---\n\n### `runTaskAutomation`\n\nRuns configured automation for a flow task. Running a `trigger_mode: manual` automation (an absent trigger mode counts as manual) is its person action, so it is permission-checked like completing a ta\n\n`POST /v2/flows/executions/{execution_id}/tasks/{task_id}/automation:run`\n\n```ts\nconst { data } = await client.runTaskAutomation(\n {\n execution_id: \'example\',\n task_id: \'example\',\n },\n {\n action_inputs: {\n cancel_flow_execution: {\n selected_closing_reason_ids: [\'string\'],\n extra_description: \'string\'\n },\n send_email: {\n subject: \'string\',\n body: \'string\',\n attachment_entity_ids: [\'string\']\n }\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "string",\n "loop_membership": [\n {\n "loop_id": "string",\n "runs_in_loop": true\n }\n ],\n "template_id": "string",\n "name": "string",\n "description": {\n "enabled": true,\n "value": "string"\n },\n "status": "UNASSIGNED",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [\n {}\n ],\n "ai_prefill": {\n "enabled": false,\n "source": {},\n "extraction_fields": [],\n "mappings": [],\n "min_confidence": 0.8,\n "instructions": "string"\n }\n },\n "journey_prefill": {\n "status": "PENDING",\n "agent_execution_id": "string",\n "dispatched_at": "1970-01-01T00:00:00.000Z",\n "extracted_at": "1970-01-01T00:00:00.000Z",\n "initial_state": {},\n "field_confidence": {},\n "dropped": [\n {}\n ]\n },\n "due_date": "2021-04-27T12:00:00.000Z",\n "due_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string",\n "phase_id": "string"\n },\n "start_date": "2021-04-27T12:00:00.000Z",\n "start_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string"\n },\n "requirements": [\n {\n "task_id": "string",\n "phase_id": "string",\n "when": "TASK_FINISHED"\n }\n ],\n "required": true,\n "subtasks": [\n {\n "id": "string",\n "name": "string",\n "party": "description",\n "required": true\n }\n ],\n "subtask_states": {},\n "journey_submission": {\n "submission_entity_id": "string",\n "submitted_at": "1970-01-01T00:00:00.000Z"\n },\n "completion_gates_reset_at": "1970-01-01T00:00:00.000Z",\n "journey_gate_waived_at": "1970-01-01T00:00:00.000Z",\n "assigned_to": ["string"],\n "ecp_placeholder_assignees": {\n "placeholder_ecp_customers": ["string"],\n "placeholder_ecp_installers": ["string"]\n },\n "analytics": {\n "started_at": "1970-01-01T00:00:00.000Z",\n "in_progress_at": "1970-01-01T00:00:00.000Z",\n "completed_at": "1970-01-01T00:00:00.000Z",\n "status_updated_at": "1970-01-01T00:00:00.000Z",\n "in_progress_by": "string",\n "completed_by": "string",\n "skipped_at": "1970-01-01T00:00:00.000Z",\n "skipped_by": "string",\n "on_hold_by": "string"\n },\n "loop_iterations": {},\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z",\n "manually_created": true,\n "enabled": true,\n "ecp": {\n "enabled": true,\n "label": "string",\n "description": "string",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [],\n "ai_prefill": {}\n }\n },\n "installer": {\n "enabled": true,\n "label": "string",\n "description": "string",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [],\n "ai_prefill": {}\n }\n },\n "partner": {\n "enabled": true,\n "label": "string",\n "description": "string"\n },\n "audience_order": ["description"],\n "taxonomies": ["string"],\n "phase_id": "string",\n "task_type": "MANUAL",\n "automation_config": {\n "flow_id": "string",\n "execution_id": "string",\n "execution_status": "string",\n "error_reason": "string",\n "input_context": {\n "source": "main_context",\n "task_id": "string",\n "trigger_id": "string",\n "with_relations": true,\n "also_pass": []\n },\n "output_context": {\n "set_as_primary": true,\n "attach_to_contexts": true\n },\n "heal_attempts": 0,\n "run_for_user_id": "string",\n "last_heal_attempted_at": "1970-01-01T00:00:00.000Z",\n "wait_for_journey_submission": true,\n "journey_id": "string",\n "journey_execution": {\n "execution_id": "string",\n "execution_status": "string",\n "error_reason": "string",\n "submission_entity_id": "string",\n "submission_created_at": "1970-01-01T00:00:00.000Z",\n "wait_overridden_at": "1970-01-01T00:00:00.000Z",\n "wait_overridden_by": "string"\n },\n "eligible_closing_reason_ids": ["string"],\n "allow_execution_note": true,\n "email_review": {\n "enabled": true,\n "allow_document_selection": true,\n "allow_subject_and_body_edit": true\n }\n },\n "automation_execution_id": "string",\n "on_failure": "stop",\n "trigger_mode": "manual",\n "schedule": {\n "mode": "immediate"\n },\n "loop_config": {\n "max_iterations": 3,\n "crt_iterations": 0\n }\n}\n```\n\n</details>\n\n---\n\n### `previewTaskEmail`\n\nRenders the email a semi-automated send-email task would send, so the person running it can review and adjust it first.\n\n`GET /v2/flows/executions/{execution_id}/tasks/{task_id}/email-preview`\n\n```ts\nconst { data } = await client.previewTaskEmail({\n execution_id: \'example\',\n task_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "subject": "string",\n "body": "string",\n "to": ["string"],\n "has_unresolved_send_time_variables": true,\n "body_edit_locked": true,\n "attachable_documents": [\n {\n "id": "string",\n "filename": "string"\n }\n ],\n "inline_images": [\n {\n "cid": "string",\n "url": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `executeTask`\n\nExecutes any kind of flow task immediately. This is the scheduler\'s dispatch endpoint: when its timer fires on the SCHEDULED task it booked, in the scheduler\'s own name, the call is the engine dispatc\n\n`POST /v2/flows/executions/{execution_id}/tasks/{task_id}/execute`\n\n```ts\nconst { data } = await client.executeTask({\n execution_id: \'example\',\n task_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "string",\n "loop_membership": [\n {\n "loop_id": "string",\n "runs_in_loop": true\n }\n ],\n "template_id": "string",\n "name": "string",\n "description": {\n "enabled": true,\n "value": "string"\n },\n "status": "UNASSIGNED",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [\n {}\n ],\n "ai_prefill": {\n "enabled": false,\n "source": {},\n "extraction_fields": [],\n "mappings": [],\n "min_confidence": 0.8,\n "instructions": "string"\n }\n },\n "journey_prefill": {\n "status": "PENDING",\n "agent_execution_id": "string",\n "dispatched_at": "1970-01-01T00:00:00.000Z",\n "extracted_at": "1970-01-01T00:00:00.000Z",\n "initial_state": {},\n "field_confidence": {},\n "dropped": [\n {}\n ]\n },\n "due_date": "2021-04-27T12:00:00.000Z",\n "due_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string",\n "phase_id": "string"\n },\n "start_date": "2021-04-27T12:00:00.000Z",\n "start_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string"\n },\n "requirements": [\n {\n "task_id": "string",\n "phase_id": "string",\n "when": "TASK_FINISHED"\n }\n ],\n "required": true,\n "subtasks": [\n {\n "id": "string",\n "name": "string",\n "party": "description",\n "required": true\n }\n ],\n "subtask_states": {},\n "journey_submission": {\n "submission_entity_id": "string",\n "submitted_at": "1970-01-01T00:00:00.000Z"\n },\n "completion_gates_reset_at": "1970-01-01T00:00:00.000Z",\n "journey_gate_waived_at": "1970-01-01T00:00:00.000Z",\n "assigned_to": ["string"],\n "ecp_placeholder_assignees": {\n "placeholder_ecp_customers": ["string"],\n "placeholder_ecp_installers": ["string"]\n },\n "analytics": {\n "started_at": "1970-01-01T00:00:00.000Z",\n "in_progress_at": "1970-01-01T00:00:00.000Z",\n "completed_at": "1970-01-01T00:00:00.000Z",\n "status_updated_at": "1970-01-01T00:00:00.000Z",\n "in_progress_by": "string",\n "completed_by": "string",\n "skipped_at": "1970-01-01T00:00:00.000Z",\n "skipped_by": "string",\n "on_hold_by": "string"\n },\n "loop_iterations": {},\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z",\n "manually_created": true,\n "enabled": true,\n "ecp": {\n "enabled": true,\n "label": "string",\n "description": "string",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [],\n "ai_prefill": {}\n }\n },\n "installer": {\n "enabled": true,\n "label": "string",\n "description": "string",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [],\n "ai_prefill": {}\n }\n },\n "partner": {\n "enabled": true,\n "label": "string",\n "description": "string"\n },\n "audience_order": ["description"],\n "taxonomies": ["string"],\n "phase_id": "string",\n "task_type": "MANUAL",\n "loop_config": {\n "max_iterations": 3,\n "crt_iterations": 0\n }\n}\n```\n\n</details>\n\n---\n\n### `patchPhase`\n\nApply updates to a phase within flow execution\n\n`PATCH /v2/flows/executions/{execution_id}/phases/{phase_id}`\n\n```ts\nconst { data } = await client.patchPhase(\n {\n execution_id: \'example\',\n phase_id: \'example\',\n },\n {\n name: \'string\',\n due_date: \'2021-04-27T12:00:00.000Z\',\n due_date_config: {\n duration: 0,\n unit: \'minutes\',\n type: \'WORKFLOW_STARTED\',\n task_id: \'string\',\n phase_id: \'string\'\n },\n assigned_to: [\'string\']\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "string",\n "template_id": "string",\n "name": "string",\n "status": "OPEN",\n "updated_at": "string",\n "due_date": "2021-04-27T12:00:00.000Z",\n "due_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string",\n "phase_id": "string"\n },\n "assigned_to": ["string"],\n "analytics": {\n "started_at": "1970-01-01T00:00:00.000Z",\n "in_progress_at": "1970-01-01T00:00:00.000Z",\n "completed_at": "1970-01-01T00:00:00.000Z",\n "status_updated_at": "1970-01-01T00:00:00.000Z",\n "in_progress_by": "string",\n "completed_by": "string",\n "skipped_at": "1970-01-01T00:00:00.000Z",\n "skipped_by": "string",\n "on_hold_by": "string"\n },\n "taxonomies": ["string"],\n "loop_config": {\n "max_iterations": 3,\n "crt_iterations": 0\n },\n "loop_membership": [\n {\n "loop_id": "string",\n "runs_in_loop": true\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `addTask`\n\nCreate a new task in current workflow execution.\n\n`POST /v2/flows/executions/{execution_id}/tasks`\n\n```ts\nconst { data } = await client.addTask(\n {\n execution_id: \'example\',\n },\n {\n previous_task_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n next_task_id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n task: {\n id: \'3fa85f64-5717-4562-b3fc-2c963f66afa6\',\n name: \'string\',\n status: \'UNASSIGNED\',\n due_date: \'2021-04-27T12:00:00.000Z\',\n due_date_config: {\n duration: 0,\n unit: \'minutes\',\n type: \'WORKFLOW_STARTED\',\n task_id: \'string\',\n phase_id: \'string\'\n },\n assigned_to: [\'string\'],\n enabled: true,\n automation_config: {\n flow_id: \'string\',\n execution_id: \'string\',\n execution_status: \'string\',\n error_reason: \'string\',\n input_context: {\n source: \'main_context\',\n task_id: \'string\',\n trigger_id: \'string\',\n with_relations: true,\n also_pass: [\n {\n source: \'main_context\'\n }\n ]\n },\n output_context: {\n set_as_primary: true,\n attach_to_contexts: true\n },\n heal_attempts: 0,\n run_for_user_id: \'string\',\n last_heal_attempted_at: \'1970-01-01T00:00:00.000Z\',\n wait_for_journey_submission: true,\n journey_id: \'string\',\n journey_execution: {\n execution_id: \'string\',\n execution_status: \'string\',\n error_reason: \'string\',\n submission_entity_id: \'string\',\n submission_created_at: \'1970-01-01T00:00:00.000Z\',\n wait_overridden_at: \'1970-01-01T00:00:00.000Z\',\n wait_overridden_by: \'string\'\n },\n eligible_closing_reason_ids: [\'string\'],\n allow_execution_note: true,\n email_review: {\n enabled: true,\n allow_document_selection: true,\n allow_subject_and_body_edit: true\n }\n },\n phase_id: \'string\',\n task_type: \'MANUAL\'\n }\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "string",\n "loop_membership": [\n {\n "loop_id": "string",\n "runs_in_loop": true\n }\n ],\n "template_id": "string",\n "name": "string",\n "description": {\n "enabled": true,\n "value": "string"\n },\n "status": "UNASSIGNED",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [\n {}\n ],\n "ai_prefill": {\n "enabled": false,\n "source": {},\n "extraction_fields": [],\n "mappings": [],\n "min_confidence": 0.8,\n "instructions": "string"\n }\n },\n "journey_prefill": {\n "status": "PENDING",\n "agent_execution_id": "string",\n "dispatched_at": "1970-01-01T00:00:00.000Z",\n "extracted_at": "1970-01-01T00:00:00.000Z",\n "initial_state": {},\n "field_confidence": {},\n "dropped": [\n {}\n ]\n },\n "due_date": "2021-04-27T12:00:00.000Z",\n "due_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string",\n "phase_id": "string"\n },\n "start_date": "2021-04-27T12:00:00.000Z",\n "start_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string"\n },\n "requirements": [\n {\n "task_id": "string",\n "phase_id": "string",\n "when": "TASK_FINISHED"\n }\n ],\n "required": true,\n "subtasks": [\n {\n "id": "string",\n "name": "string",\n "party": "description",\n "required": true\n }\n ],\n "subtask_states": {},\n "journey_submission": {\n "submission_entity_id": "string",\n "submitted_at": "1970-01-01T00:00:00.000Z"\n },\n "completion_gates_reset_at": "1970-01-01T00:00:00.000Z",\n "journey_gate_waived_at": "1970-01-01T00:00:00.000Z",\n "assigned_to": ["string"],\n "ecp_placeholder_assignees": {\n "placeholder_ecp_customers": ["string"],\n "placeholder_ecp_installers": ["string"]\n },\n "analytics": {\n "started_at": "1970-01-01T00:00:00.000Z",\n "in_progress_at": "1970-01-01T00:00:00.000Z",\n "completed_at": "1970-01-01T00:00:00.000Z",\n "status_updated_at": "1970-01-01T00:00:00.000Z",\n "in_progress_by": "string",\n "completed_by": "string",\n "skipped_at": "1970-01-01T00:00:00.000Z",\n "skipped_by": "string",\n "on_hold_by": "string"\n },\n "loop_iterations": {},\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z",\n "manually_created": true,\n "enabled": true,\n "ecp": {\n "enabled": true,\n "label": "string",\n "description": "string",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [],\n "ai_prefill": {}\n }\n },\n "installer": {\n "enabled": true,\n "label": "string",\n "description": "string",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [],\n "ai_prefill": {}\n }\n },\n "partner": {\n "enabled": true,\n "label": "string",\n "description": "string"\n },\n "audience_order": ["description"],\n "taxonomies": ["string"],\n "phase_id": "string",\n "task_type": "MANUAL",\n "loop_config": {\n "max_iterations": 3,\n "crt_iterations": 0\n }\n}\n```\n\n</details>\n\n---\n\n### `cancelTaskSchedule`\n\nCancels a scheduled task, deleting the schedule and marking the task as skipped.\n\n`DELETE /v2/flows/executions/{execution_id}/tasks/{task_id}/schedule`\n\n```ts\nconst { data } = await client.cancelTaskSchedule({\n execution_id: \'example\',\n task_id: \'example\',\n})\n```\n\n---\n\n### `reconcileAutomationTask`\n\nReconciles an automation task\'s status against its linked automation execution.\n\n`POST /v2/flows/executions/{execution_id}/tasks/{task_id}/reconcile-automation`\n\n```ts\nconst { data } = await client.reconcileAutomationTask({\n execution_id: \'example\',\n task_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "string",\n "loop_source": "loops",\n "flow_template_id": "string",\n "org_id": "string",\n "name": "string",\n "created_at": "string",\n "updated_at": "string",\n "due_date": "string",\n "due_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string",\n "phase_id": "string"\n },\n "status": "STARTED",\n "assigned_to": ["string"],\n "analytics": {\n "started_at": "string",\n "completed_at": "string",\n "closed_at": "string",\n "started_by": "string",\n "started_by_org_id": "string",\n "closed_by": "string",\n "completed_by": "string"\n },\n "contexts": [\n {\n "entity_id": "string",\n "entity_schema": "string",\n "is_primary": false,\n "promoted_by_task_id": "string",\n "promoted_at": "1970-01-01T00:00:00.000Z",\n "demoted_by_task_id": "string",\n "added_by_task_id": "string"\n }\n ],\n "visibility": "entity_views",\n "visible_on": [\n {\n "entity_id": "string",\n "entity_schema": "string",\n "kind": "context",\n "anchor_entity_id": "string",\n "rule_id": "string"\n }\n ],\n "crt_tasks": [\n {\n "id": "string",\n "crt_since": "1970-01-01T00:00:00.000Z"\n }\n ],\n "phases": [\n {\n "id": "string",\n "template_id": "string",\n "name": "string",\n "status": "OPEN",\n "updated_at": "string",\n "due_date": "2021-04-27T12:00:00.000Z",\n "due_date_config": {},\n "assigned_to": ["string"],\n "analytics": {},\n "taxonomies": ["string"],\n "loop_config": {},\n "loop_membership": []\n }\n ],\n "stages": [\n {\n "id": "string",\n "name": "string",\n "description": "string",\n "entry_node_id": "string",\n "cut_edge_ids": ["string"],\n "color": "string",\n "portal_names": {},\n "portal_descriptions": {}\n }\n ],\n "portal_titles": {\n "ecp": "string",\n "installer": "string"\n },\n "tasks": [\n {\n "id": "string",\n "loop_membership": [],\n "template_id": "string",\n "name": "string",\n "description": {},\n "status": "UNASSIGNED",\n "journey": {},\n "journey_prefill": {},\n "due_date": "2021-04-27T12:00:00.000Z",\n "due_date_config": {},\n "start_date": "2021-04-27T12:00:00.000Z",\n "start_date_config": {},\n "requirements": [],\n "required": true,\n "subtasks": [],\n "subtask_states": {},\n "journey_submission": {},\n "completion_gates_reset_at": "1970-01-01T00:00:00.000Z",\n "journey_gate_waived_at": "1970-01-01T00:00:00.000Z",\n "assigned_to": ["string"],\n "ecp_placeholder_assignees": {},\n "analytics": {},\n "loop_iterations": {},\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z",\n "manually_created": true,\n "enabled": true,\n "ecp": {},\n "installer": {},\n "partner": {},\n "audience_order": ["description"],\n "taxonomies": ["string"],\n "phase_id": "string",\n "task_type": "MANUAL",\n "loop_config": {}\n }\n ],\n "edges": [\n {\n "id": "string",\n "from_id": "string",\n "to_id": "string",\n "condition_id": "abc123",\n "none_met": true,\n "loop_id": "string"\n }\n ],\n "_execution_chain": {\n "parent_execution_id": "string",\n "parent_task_id": "string",\n "depth": 0\n },\n "_automation_chain": ["string"],\n "closing_reason": {\n "selected_reasons": [\n {}\n ],\n "configured_reasons": [\n {}\n ],\n "extra_description": "string"\n },\n "available_in_ecp": true,\n "entity_sync": [\n {\n "trigger": {},\n "target": {},\n "value": {}\n }\n ],\n "taxonomies": ["string"],\n "trigger": {\n "type": "MANUAL",\n "automation_config": {\n "flow_id": "string",\n "execution_id": "string",\n "execution_status": "string",\n "error_reason": "string",\n "input_context": {},\n "output_context": {},\n "heal_attempts": 0,\n "run_for_user_id": "string",\n "last_heal_attempted_at": "1970-01-01T00:00:00.000Z",\n "wait_for_journey_submission": true,\n "journey_id": "string",\n "journey_execution": {},\n "eligible_closing_reason_ids": ["string"],\n "allow_execution_note": true,\n "email_review": {}\n },\n "trigger_id": "string"\n },\n "configured_triggers": [\n {\n "id": "string",\n "type": "string",\n "primary": true,\n "entity_schema": "string",\n "automation_id": "string",\n "journey_id": "string"\n }\n ],\n "singleClosingReasonSelection": true,\n "linear": true\n}\n```\n\n</details>\n\n---\n\n### `runTaskScheduleNow`\n\nCancels the pending schedule for a task and immediately triggers its automation execution. Always a person\'s request, so a `trigger_mode: manual` automation (an absent trigger mode counts as manual) i\n\n`POST /v2/flows/executions/{execution_id}/tasks/{task_id}/schedule/run-now`\n\n```ts\nconst { data } = await client.runTaskScheduleNow({\n execution_id: \'example\',\n task_id: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "id": "string",\n "loop_membership": [\n {\n "loop_id": "string",\n "runs_in_loop": true\n }\n ],\n "template_id": "string",\n "name": "string",\n "description": {\n "enabled": true,\n "value": "string"\n },\n "status": "UNASSIGNED",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [\n {}\n ],\n "ai_prefill": {\n "enabled": false,\n "source": {},\n "extraction_fields": [],\n "mappings": [],\n "min_confidence": 0.8,\n "instructions": "string"\n }\n },\n "journey_prefill": {\n "status": "PENDING",\n "agent_execution_id": "string",\n "dispatched_at": "1970-01-01T00:00:00.000Z",\n "extracted_at": "1970-01-01T00:00:00.000Z",\n "initial_state": {},\n "field_confidence": {},\n "dropped": [\n {}\n ]\n },\n "due_date": "2021-04-27T12:00:00.000Z",\n "due_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string",\n "phase_id": "string"\n },\n "start_date": "2021-04-27T12:00:00.000Z",\n "start_date_config": {\n "duration": 0,\n "unit": "minutes",\n "type": "WORKFLOW_STARTED",\n "task_id": "string"\n },\n "requirements": [\n {\n "task_id": "string",\n "phase_id": "string",\n "when": "TASK_FINISHED"\n }\n ],\n "required": true,\n "subtasks": [\n {\n "id": "string",\n "name": "string",\n "party": "description",\n "required": true\n }\n ],\n "subtask_states": {},\n "journey_submission": {\n "submission_entity_id": "string",\n "submitted_at": "1970-01-01T00:00:00.000Z"\n },\n "completion_gates_reset_at": "1970-01-01T00:00:00.000Z",\n "journey_gate_waived_at": "1970-01-01T00:00:00.000Z",\n "assigned_to": ["string"],\n "ecp_placeholder_assignees": {\n "placeholder_ecp_customers": ["string"],\n "placeholder_ecp_installers": ["string"]\n },\n "analytics": {\n "started_at": "1970-01-01T00:00:00.000Z",\n "in_progress_at": "1970-01-01T00:00:00.000Z",\n "completed_at": "1970-01-01T00:00:00.000Z",\n "status_updated_at": "1970-01-01T00:00:00.000Z",\n "in_progress_by": "string",\n "completed_by": "string",\n "skipped_at": "1970-01-01T00:00:00.000Z",\n "skipped_by": "string",\n "on_hold_by": "string"\n },\n "loop_iterations": {},\n "created_at": "1970-01-01T00:00:00.000Z",\n "updated_at": "1970-01-01T00:00:00.000Z",\n "manually_created": true,\n "enabled": true,\n "ecp": {\n "enabled": true,\n "label": "string",\n "description": "string",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [],\n "ai_prefill": {}\n }\n },\n "installer": {\n "enabled": true,\n "label": "string",\n "description": "string",\n "journey": {\n "id": "string",\n "journeyId": "string",\n "name": "string",\n "portal_button_label": "string",\n "complete_task_automatically": true,\n "journey_submission_required": true,\n "context_parameters": [],\n "ai_prefill": {}\n }\n },\n "partner": {\n "enabled": true,\n "label": "string",\n "description": "string"\n },\n "audience_order": ["description"],\n "taxonomies": ["string"],\n "phase_id": "string",\n "task_type": "MANUAL",\n "loop_config": {\n "max_iterations": 3,\n "crt_iterations": 0\n }\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `WorkflowExecutionCreateReq`\n\n```ts\ntype WorkflowExecutionCreateReq = {\n workflowId: string\n trigger?: "MANUAL" | "AUTOMATIC"\n assignedTo?: string[]\n contexts?: Array<{\n id: string\n title: string\n schema: string\n }>\n purposes?: string[]\n}\n```\n\n### `WorkflowExecutionUpdateReq`\n\n```ts\ntype WorkflowExecutionUpdateReq = {\n status?: "STARTED" | "DONE" | "CLOSED"\n assignedTo?: string[]\n selectedClosingReasons?: Array<{\n id: string\n title: string\n }>\n closingReasonDescription?: string\n dueDate?: string\n dynamicDueDate?: {\n numberOfUnits: number\n timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"\n actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"\n stepId?: string\n phaseId?: string\n }\n closedBy?: string\n contexts?: Array<{\n id: string\n title: string\n schema: string\n }>\n completedTime?: string\n}\n```\n\n### `ClosingReason`\n\n```ts\ntype ClosingReason = {\n id: string\n title: string\n}\n```\n\n### `WorkflowContext`\n\n```ts\ntype WorkflowContext = {\n id: string\n title: string\n schema: string\n}\n```\n\n### `WorkflowExecutionBase`\n\n```ts\ntype WorkflowExecutionBase = {\n id?: string\n definitionId?: string\n orgId?: string\n name?: string\n creationTime?: string\n lastUpdateTime?: string\n dueDate?: string\n completedTime?: string\n dynamicDueDate?: {\n numberOfUnits: number\n timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"\n actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"\n stepId?: string\n phaseId?: string\n }\n status?: "STARTED" | "DONE" | "CLOSED"\n trigger?: "MANUAL" | "AUTOMATIC"\n assignedTo?: string[]\n lastModifiedBy?: string\n contexts?: Array<{\n id: string\n title: string\n schema: string\n }>\n nextOpenStep?: {\n id?: string\n entityRefId?: string\n }\n configuredClosingReasonSnapshot?: Array<{\n id: string\n title: string\n }>\n selectedClosingReasons?: Array<{\n id: string\n title: string\n }>\n closingReasonDescription?: string\n enableECPWorkflow?: boolean\n updateEntityAttributes?: Array<{\n source: "workflow_status" | "current_section" | "current_step"\n target: {\n entitySchema: { ... }\n entityAttribute: { ... }\n }\n }>\n version?: number\n taxonomies?: string[]\n singleClosingReasonSelection?: boolean\n}\n```\n\n### `WorkflowExecutionSlim`\n\n```ts\ntype WorkflowExecutionSlim = {\n id?: string\n definitionId?: string\n orgId?: string\n name?: string\n creationTime?: string\n lastUpdateTime?: string\n dueDate?: string\n completedTime?: string\n dynamicDueDate?: {\n numberOfUnits: number\n timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"\n actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"\n stepId?: string\n phaseId?: string\n }\n status?: "STARTED" | "DONE" | "CLOSED"\n trigger?: "MANUAL" | "AUTOMATIC"\n assignedTo?: string[]\n lastModifiedBy?: string\n contexts?: Array<{\n id: string\n title: string\n schema: string\n }>\n nextOpenStep?: {\n id?: string\n entityRefId?: string\n }\n configuredClosingReasonSnapshot?: Array<{\n id: string\n title: string\n }>\n selectedClosingReasons?: Array<{\n id: string\n title: string\n }>\n closingReasonDescription?: string\n enableECPWorkflow?: boolean\n updateEntityAttributes?: Array<{\n source: "workflow_status" | "current_section" | "current_step"\n target: {\n entitySchema: { ... }\n entityAttribute: { ... }\n }\n }>\n version?: number\n taxonomies?: string[]\n singleClosingReasonSelection?: boolean\n flow: Array<{\n id: string\n definitionId?: string\n name: string\n userIds?: number[]\n assignedTo?: string[]\n dueDate?: string\n dynamicDueDate?: {\n numberOfUnits: { ... }\n timePeriod: { ... }\n actionTypeCondition?: { ... }\n stepId?: { ... }\n phaseId?: { ... }\n }\n startedTime?: string\n completedTime?: string\n status?: "OPEN" | "IN_PROGRESS" | "COMPLETED"\n type: "STEP" | "SECTION"\n steps: Array<{\n id: { ... }\n definitionId?: { ... }\n entityRefId?: { ... }\n name: { ... }\n description?: { ... }\n type: { ... }\n ecp?: { ... }\n installer?: { ... }\n partner?: { ... }\n enabled?: { ... }\n requirements?: { ... }\n executionType?: { ... }\n sectionId?: { ... }\n executionId?: { ... }\n userIds?: { ... }\n assignedTo?: { ... }\n assignedToInProgress?: { ... }\n assignedToOnHold?: { ... }\n status?: { ... }\n created?: { ... }\n lastUpdated?: { ... }\n statusLastUpdated?: { ... }\n startedTime?: { ... }\n completedTime?: { ... }\n dueDate?: { ... }\n dynamicDueDate?: { ... }\n manuallyCreated?: { ... }\n automationConfig?: { ... }\n journey?: { ... }\n taxonomies?: { ... }\n }>\n taxonomies?: string[]\n // ...\n}\n```\n\n### `FlowSlim`\n\n```ts\ntype FlowSlim = {\n flow: Array<{\n id: string\n definitionId?: string\n name: string\n userIds?: number[]\n assignedTo?: string[]\n dueDate?: string\n dynamicDueDate?: {\n numberOfUnits: { ... }\n timePeriod: { ... }\n actionTypeCondition?: { ... }\n stepId?: { ... }\n phaseId?: { ... }\n }\n startedTime?: string\n completedTime?: string\n status?: "OPEN" | "IN_PROGRESS" | "COMPLETED"\n type: "STEP" | "SECTION"\n steps: Array<{\n id: { ... }\n definitionId?: { ... }\n entityRefId?: { ... }\n name: { ... }\n description?: { ... }\n type: { ... }\n ecp?: { ... }\n installer?: { ... }\n partner?: { ... }\n enabled?: { ... }\n requirements?: { ... }\n executionType?: { ... }\n sectionId?: { ... }\n executionId?: { ... }\n userIds?: { ... }\n assignedTo?: { ... }\n assignedToInProgress?: { ... }\n assignedToOnHold?: { ... }\n status?: { ... }\n created?: { ... }\n lastUpdated?: { ... }\n statusLastUpdated?: { ... }\n startedTime?: { ... }\n completedTime?: { ... }\n dueDate?: { ... }\n dynamicDueDate?: { ... }\n manuallyCreated?: { ... }\n automationConfig?: { ... }\n journey?: { ... }\n taxonomies?: { ... }\n }>\n taxonomies?: string[]\n } | {\n id: string\n definitionId?: string\n entityRefId?: string\n name: string\n description?: {\n enabled?: { ... }\n value?: { ... }\n }\n type: "STEP" | "SECTION"\n ecp?: {\n enabled?: { ... }\n label?: { ... }\n description?: { ... }\n journey?: { ... }\n }\n installer?: {\n enabled?: { ... }\n label?: { ... }\n description?: { ... }\n journey?: { ... }\n }\n partner?: {\n enabled?: { ... }\n label?: { ... }\n description?: { ... }\n }\n enabled?: boolean\n requirements?: Array<{\n definitionId: { ... }\n type: { ... }\n condition: { ... }\n }>\n executionType?: "MANUAL" | "AUTOMATION"\n sectionId?: string\n executionId?: string\n userIds?: number[]\n assignedTo?: string[]\n assignedToInProgress?: string\n assignedToOnHold?: string\n status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n created?: string\n lastUpdated?: string\n statusLastUpdated?: string\n startedTime?: string\n completedTime?: string\n dueDate?: string\n dynamicDueDate?: {\n // ...\n}\n```\n\n### `Flow`\n\n```ts\ntype Flow = {\n flow: Array<{\n id: string\n definitionId?: string\n name: string\n userIds?: number[]\n assignedTo?: string[]\n dueDate?: string\n dynamicDueDate?: {\n numberOfUnits: { ... }\n timePeriod: { ... }\n actionTypeCondition?: { ... }\n stepId?: { ... }\n phaseId?: { ... }\n }\n startedTime?: string\n completedTime?: string\n status?: "OPEN" | "IN_PROGRESS" | "COMPLETED"\n type: "STEP" | "SECTION"\n steps: Array<{\n id: { ... }\n definitionId?: { ... }\n entityRefId?: { ... }\n name: { ... }\n description?: { ... }\n type: { ... }\n ecp?: { ... }\n installer?: { ... }\n partner?: { ... }\n enabled?: { ... }\n requirements?: { ... }\n executionType?: { ... }\n sectionId?: { ... }\n executionId?: { ... }\n userIds?: { ... }\n assignedTo?: { ... }\n assignedToInProgress?: { ... }\n assignedToOnHold?: { ... }\n status?: { ... }\n created?: { ... }\n lastUpdated?: { ... }\n statusLastUpdated?: { ... }\n startedTime?: { ... }\n completedTime?: { ... }\n dueDate?: { ... }\n dynamicDueDate?: { ... }\n manuallyCreated?: { ... }\n automationConfig?: { ... }\n journey?: { ... }\n taxonomies?: { ... }\n }>\n taxonomies?: string[]\n } | {\n id: string\n definitionId?: string\n entityRefId?: string\n name: string\n description?: {\n enabled?: { ... }\n value?: { ... }\n }\n type: "STEP" | "SECTION"\n ecp?: {\n enabled?: { ... }\n label?: { ... }\n description?: { ... }\n journey?: { ... }\n }\n installer?: {\n enabled?: { ... }\n label?: { ... }\n description?: { ... }\n journey?: { ... }\n }\n partner?: {\n enabled?: { ... }\n label?: { ... }\n description?: { ... }\n }\n enabled?: boolean\n requirements?: Array<{\n definitionId: { ... }\n type: { ... }\n condition: { ... }\n }>\n executionType?: "MANUAL" | "AUTOMATION"\n sectionId?: string\n executionId?: string\n userIds?: number[]\n assignedTo?: string[]\n assignedToInProgress?: string\n assignedToOnHold?: string\n status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n created?: string\n lastUpdated?: string\n statusLastUpdated?: string\n startedTime?: string\n completedTime?: string\n dueDate?: string\n dynamicDueDate?: {\n // ...\n}\n```\n\n### `WorkflowExecution`\n\n```ts\ntype WorkflowExecution = {\n id?: string\n definitionId?: string\n orgId?: string\n name?: string\n creationTime?: string\n lastUpdateTime?: string\n dueDate?: string\n completedTime?: string\n dynamicDueDate?: {\n numberOfUnits: number\n timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"\n actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"\n stepId?: string\n phaseId?: string\n }\n status?: "STARTED" | "DONE" | "CLOSED"\n trigger?: "MANUAL" | "AUTOMATIC"\n assignedTo?: string[]\n lastModifiedBy?: string\n contexts?: Array<{\n id: string\n title: string\n schema: string\n }>\n nextOpenStep?: {\n id?: string\n entityRefId?: string\n }\n configuredClosingReasonSnapshot?: Array<{\n id: string\n title: string\n }>\n selectedClosingReasons?: Array<{\n id: string\n title: string\n }>\n closingReasonDescription?: string\n enableECPWorkflow?: boolean\n updateEntityAttributes?: Array<{\n source: "workflow_status" | "current_section" | "current_step"\n target: {\n entitySchema: { ... }\n entityAttribute: { ... }\n }\n }>\n version?: number\n taxonomies?: string[]\n singleClosingReasonSelection?: boolean\n flow: Array<{\n id: string\n definitionId?: string\n name: string\n userIds?: number[]\n assignedTo?: string[]\n dueDate?: string\n dynamicDueDate?: {\n numberOfUnits: { ... }\n timePeriod: { ... }\n actionTypeCondition?: { ... }\n stepId?: { ... }\n phaseId?: { ... }\n }\n startedTime?: string\n completedTime?: string\n status?: "OPEN" | "IN_PROGRESS" | "COMPLETED"\n type: "STEP" | "SECTION"\n steps: Array<{\n id: { ... }\n definitionId?: { ... }\n entityRefId?: { ... }\n name: { ... }\n description?: { ... }\n type: { ... }\n ecp?: { ... }\n installer?: { ... }\n partner?: { ... }\n enabled?: { ... }\n requirements?: { ... }\n executionType?: { ... }\n sectionId?: { ... }\n executionId?: { ... }\n userIds?: { ... }\n assignedTo?: { ... }\n assignedToInProgress?: { ... }\n assignedToOnHold?: { ... }\n status?: { ... }\n created?: { ... }\n lastUpdated?: { ... }\n statusLastUpdated?: { ... }\n startedTime?: { ... }\n completedTime?: { ... }\n dueDate?: { ... }\n dynamicDueDate?: { ... }\n manuallyCreated?: { ... }\n automationConfig?: { ... }\n journey?: { ... }\n taxonomies?: { ... }\n }>\n taxonomies?: string[]\n // ...\n}\n```\n\n### `WorkflowStatus`\n\n```ts\ntype WorkflowStatus = "STARTED" | "DONE" | "CLOSED"\n```\n\n### `SectionSimplified`\n\nA group of Steps that define the progress of the Workflow\n\n```ts\ntype SectionSimplified = {\n id: string\n definitionId?: string\n name: string\n type: "STEP" | "SECTION"\n steps: Array<{\n id: string\n definitionId?: string\n entityRefId?: string\n name: string\n description?: {\n enabled?: { ... }\n value?: { ... }\n }\n type: "STEP" | "SECTION"\n ecp?: {\n enabled?: { ... }\n label?: { ... }\n description?: { ... }\n journey?: { ... }\n }\n installer?: {\n enabled?: { ... }\n label?: { ... }\n description?: { ... }\n journey?: { ... }\n }\n partner?: {\n enabled?: { ... }\n label?: { ... }\n description?: { ... }\n }\n enabled?: boolean\n requirements?: Array<{\n definitionId: { ... }\n type: { ... }\n condition: { ... }\n }>\n executionType?: "MANUAL" | "AUTOMATION"\n }>\n assignedTo?: string[]\n}\n```\n\n### `Section`\n\nA group of Steps that define the progress of the Workflow\n\n```ts\ntype Section = {\n id: string\n definitionId?: string\n name: string\n userIds?: number[]\n assignedTo?: string[]\n dueDate?: string\n dynamicDueDate?: {\n numberOfUnits: number\n timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"\n actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"\n stepId?: string\n phaseId?: string\n }\n startedTime?: string\n completedTime?: string\n status?: "OPEN" | "IN_PROGRESS" | "COMPLETED"\n type: "STEP" | "SECTION"\n steps: Array<{\n id: string\n definitionId?: string\n entityRefId?: string\n name: string\n description?: {\n enabled?: { ... }\n value?: { ... }\n }\n type: "STEP" | "SECTION"\n ecp?: {\n enabled?: { ... }\n label?: { ... }\n description?: { ... }\n journey?: { ... }\n }\n installer?: {\n enabled?: { ... }\n label?: { ... }\n description?: { ... }\n journey?: { ... }\n }\n partner?: {\n enabled?: { ... }\n label?: { ... }\n description?: { ... }\n }\n enabled?: boolean\n requirements?: Array<{\n definitionId: { ... }\n type: { ... }\n condition: { ... }\n }>\n executionType?: "MANUAL" | "AUTOMATION"\n sectionId?: string\n executionId?: string\n userIds?: number[]\n assignedTo?: string[]\n assignedToInProgress?: string\n assignedToOnHold?: string\n status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n created?: string\n lastUpdated?: string\n statusLastUpdated?: string\n startedTime?: string\n completedTime?: string\n dueDate?: string\n dynamicDueDate?: {\n numberOfUnits: { ... }\n timePeriod: { ... }\n actionTypeCondition?: { ... }\n stepId?: { ... }\n phaseId?: { ... }\n }\n manuallyCreated?: boolean\n automationConfig?: {\n flowId: { ... }\n executionId?: { ... }\n executionStatus?: { ... }\n }\n journey?: {\n id?: { ... }\n journeyId?: { ... }\n name?: { ... }\n portal_button_label?: { ... }\n complete_task_automatically?: { ... }\n journey_submission_required?: { ... }\n context_parameters?: { ... }\n ai_prefill?: { ... }\n }\n taxonomies?: string[]\n }>\n taxonomies?: string[]\n}\n```\n\n### `StepId`\n\n```ts\ntype StepId = {\n id?: string\n entityRefId?: string\n}\n```\n\n### `StepSimplified`\n\n```ts\ntype StepSimplified = {\n id: string\n definitionId?: string\n entityRefId?: string\n name: string\n description?: {\n enabled?: boolean\n value?: string\n }\n type: "STEP" | "SECTION"\n ecp?: {\n enabled?: boolean\n label?: string\n description?: string\n journey?: {\n id?: { ... }\n journeyId?: { ... }\n name?: { ... }\n portal_button_label?: { ... }\n complete_task_automatically?: { ... }\n journey_submission_required?: { ... }\n context_parameters?: { ... }\n ai_prefill?: { ... }\n }\n }\n installer?: {\n enabled?: boolean\n label?: string\n description?: string\n journey?: {\n id?: { ... }\n journeyId?: { ... }\n name?: { ... }\n portal_button_label?: { ... }\n complete_task_automatically?: { ... }\n journey_submission_required?: { ... }\n context_parameters?: { ... }\n ai_prefill?: { ... }\n }\n }\n partner?: {\n enabled?: boolean\n label?: string\n description?: string\n }\n enabled?: boolean\n requirements?: Array<{\n definitionId: string\n type: "STEP" | "SECTION"\n condition: "CLOSED"\n }>\n executionType?: "MANUAL" | "AUTOMATION"\n}\n```\n\n### `Step`\n\n```ts\ntype Step = {\n id: string\n definitionId?: string\n entityRefId?: string\n name: string\n description?: {\n enabled?: boolean\n value?: string\n }\n type: "STEP" | "SECTION"\n ecp?: {\n enabled?: boolean\n label?: string\n description?: string\n journey?: {\n id?: { ... }\n journeyId?: { ... }\n name?: { ... }\n portal_button_label?: { ... }\n complete_task_automatically?: { ... }\n journey_submission_required?: { ... }\n context_parameters?: { ... }\n ai_prefill?: { ... }\n }\n }\n installer?: {\n enabled?: boolean\n label?: string\n description?: string\n journey?: {\n id?: { ... }\n journeyId?: { ... }\n name?: { ... }\n portal_button_label?: { ... }\n complete_task_automatically?: { ... }\n journey_submission_required?: { ... }\n context_parameters?: { ... }\n ai_prefill?: { ... }\n }\n }\n partner?: {\n enabled?: boolean\n label?: string\n description?: string\n }\n enabled?: boolean\n requirements?: Array<{\n definitionId: string\n type: "STEP" | "SECTION"\n condition: "CLOSED"\n }>\n executionType?: "MANUAL" | "AUTOMATION"\n sectionId?: string\n executionId?: string\n userIds?: number[]\n assignedTo?: string[]\n assignedToInProgress?: string\n assignedToOnHold?: string\n status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n created?: string\n lastUpdated?: string\n statusLastUpdated?: string\n startedTime?: string\n completedTime?: string\n dueDate?: string\n dynamicDueDate?: {\n numberOfUnits: number\n timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"\n actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"\n stepId?: string\n phaseId?: string\n }\n manuallyCreated?: boolean\n automationConfig?: {\n flowId: string\n executionId?: string\n executionStatus?: string\n }\n journey?: {\n id?: string\n journeyId?: string\n name?: string\n portal_button_label?: string\n complete_task_automatically?: boolean\n journey_submission_required?: boolean\n context_parameters?: Array<{\n key: { ... }\n value: { ... }\n }>\n ai_prefill?: {\n enabled?: { ... }\n source?: { ... }\n extraction_fields?: { ... }\n mappings?: { ... }\n min_confidence?: { ... }\n instructions?: { ... }\n }\n }\n taxonomies?: string[]\n}\n```\n\n### `StepExtended`\n\n```ts\ntype StepExtended = {\n executionId: string\n executionName: string\n executionStatus: "STARTED" | "DONE" | "CLOSED"\n contexts?: Array<{\n id: string\n title: string\n schema: string\n }>\n}\n```\n\n### `StepStatus`\n\n**Note**: "UNASSIGNED" and "ASSIGNED" are deprecated and will be removed in a future version. Please use "PENDING" instead. Status values for workflow execution steps/tasks:\n- **UNASSIGNED**: Step has not been assigned to any user (deprecated - use PENDING instead)\n- **ASSIGNED**: Step has been assi\n\n```ts\ntype StepStatus = "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n```\n\n### `SectionStatus`\n\n```ts\ntype SectionStatus = "OPEN" | "IN_PROGRESS" | "COMPLETED"\n```\n\n### `StepType`\n\n```ts\ntype StepType = "MANUAL" | "AUTOMATION"\n```\n\n### `StepJourney`\n\n```ts\ntype StepJourney = {\n id?: string\n journeyId?: string\n name?: string\n portal_button_label?: string\n complete_task_automatically?: boolean\n journey_submission_required?: boolean\n context_parameters?: Array<{\n key: string\n value: string\n }>\n ai_prefill?: {\n enabled?: boolean\n source?: {\n type?: { ... }\n input_entity?: { ... }\n }\n extraction_fields?: Array<{\n key: { ... }\n type: { ... }\n description?: { ... }\n description_overridden?: { ... }\n enum?: { ... }\n }>\n mappings?: Array<{\n source: { ... }\n block_id: { ... }\n block_type: { ... }\n block_field?: { ... }\n }>\n min_confidence?: number\n instructions?: string\n }\n}\n```\n\n### `JourneyContextParameter`\n\n```ts\ntype JourneyContextParameter = {\n key: string\n value: string\n}\n```\n\n### `AiPrefillConfig`\n\nAI extraction + prefill configuration for the attached journey (Flows v2 only)\n\n```ts\ntype AiPrefillConfig = {\n enabled?: boolean\n source?: {\n type?: "flow_context"\n input_entity?: "thread" | "first_email" | "last_email"\n }\n extraction_fields?: Array<{\n key: string\n type: "string" | "number" | "boolean" | "date" | "enum"\n description?: string\n description_overridden?: boolean\n enum?: string[]\n }>\n mappings?: Array<{\n source: string\n block_id: string\n block_type: "text-input" | "number-input" | "personal-information" | "meter-reading"\n block_field?: string\n }>\n min_confidence?: number\n instructions?: string\n}\n```\n\n### `AiPrefillExtractionField`\n\n```ts\ntype AiPrefillExtractionField = {\n key: string\n type: "string" | "number" | "boolean" | "date" | "enum"\n description?: string\n description_overridden?: boolean\n enum?: string[]\n}\n```\n\n### `AiPrefillMapping`\n\n```ts\ntype AiPrefillMapping = {\n source: string\n block_id: string\n block_type: "text-input" | "number-input" | "personal-information" | "meter-reading"\n block_field?: string\n}\n```\n\n### `JourneyPrefill`\n\nServer-tracked outcome of an AI journey-prefill dispatch for this task (Flows v2 only). Absent when the task has no `journey.ai_prefill` config, or before the task becomes current.\n\n```ts\ntype JourneyPrefill = {\n status: "PENDING" | "READY" | "FAILED" | "SKIPPED"\n agent_execution_id?: string\n dispatched_at?: string // date-time\n extracted_at?: string // date-time\n initial_state?: Record<string, unknown>\n field_confidence?: Record<string, number>\n dropped?: Array<{\n source?: string\n block_id?: string\n reason: string\n }>\n}\n```\n\n### `AutomationConfig`\n\nConfiguration for automation execution to run\n\n```ts\ntype AutomationConfig = {\n flowId: string\n executionId?: string\n executionStatus?: string\n}\n```\n\n### `ECPDetails`\n\nDetails regarding ECP for the workflow step\n\n```ts\ntype ECPDetails = {\n enabled?: boolean\n label?: string\n description?: string\n journey?: {\n id?: string\n journeyId?: string\n name?: string\n portal_button_label?: string\n complete_task_automatically?: boolean\n journey_submission_required?: boolean\n context_parameters?: Array<{\n key: { ... }\n value: { ... }\n }>\n ai_prefill?: {\n enabled?: { ... }\n source?: { ... }\n extraction_fields?: { ... }\n mappings?: { ... }\n min_confidence?: { ... }\n instructions?: { ... }\n }\n }\n}\n```\n\n### `PartnerDetails`\n\nDetails regarding partner for the workflow step\n\n```ts\ntype PartnerDetails = {\n enabled?: boolean\n label?: string\n description?: string\n}\n```\n\n### `StepDescription`\n\nLonger information regarding Task\n\n```ts\ntype StepDescription = {\n enabled?: boolean\n value?: string\n}\n```\n\n### `ItemType`\n\n```ts\ntype ItemType = "STEP" | "SECTION"\n```\n\n### `TriggerType`\n\n```ts\ntype TriggerType = "MANUAL" | "AUTOMATIC"\n```\n\n### `CreateStepReq`\n\n```ts\ntype CreateStepReq = {\n insertionIndex: number\n name: string\n description?: {\n enabled: boolean\n value: string\n }\n status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n sectionId?: string\n executionType?: "MANUAL" | "AUTOMATION"\n automationConfig?: {\n flowId: string\n executionId?: string\n executionStatus?: string\n }\n}\n```\n\n### `UpdateStepReq`\n\n```ts\ntype UpdateStepReq = {\n stepId?: string\n entityRefId?: string\n userIds?: number[]\n assignedTo?: string[]\n assignedToInProgress?: string\n assignedToOnHold?: string\n status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n dueDate?: string\n dynamicDueDate?: {\n numberOfUnits: number\n timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"\n actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"\n stepId?: string\n phaseId?: string\n }\n name?: string\n description?: {\n enabled: boolean\n value: string\n }\n position?: {\n index: number\n sectionId?: string\n }\n automationConfig?: {\n flowId: string\n executionId?: string\n executionStatus?: string\n }\n journey?: {\n id?: string\n journeyId?: string\n name?: string\n portal_button_label?: string\n complete_task_automatically?: boolean\n journey_submission_required?: boolean\n context_parameters?: Array<{\n key: { ... }\n value: { ... }\n }>\n ai_prefill?: {\n enabled?: { ... }\n source?: { ... }\n extraction_fields?: { ... }\n mappings?: { ... }\n min_confidence?: { ... }\n instructions?: { ... }\n }\n }\n startedTime?: string\n completedTime?: string\n}\n```\n\n### `StepPositionAt`\n\n```ts\ntype StepPositionAt = {\n index: number\n sectionId?: string\n}\n```\n\n### `UpdateStepResp`\n\n```ts\ntype UpdateStepResp = {\n id: string\n definitionId?: string\n entityRefId?: string\n name: string\n description?: {\n enabled?: boolean\n value?: string\n }\n type: "STEP" | "SECTION"\n ecp?: {\n enabled?: boolean\n label?: string\n description?: string\n journey?: {\n id?: { ... }\n journeyId?: { ... }\n name?: { ... }\n portal_button_label?: { ... }\n complete_task_automatically?: { ... }\n journey_submission_required?: { ... }\n context_parameters?: { ... }\n ai_prefill?: { ... }\n }\n }\n installer?: {\n enabled?: boolean\n label?: string\n description?: string\n journey?: {\n id?: { ... }\n journeyId?: { ... }\n name?: { ... }\n portal_button_label?: { ... }\n complete_task_automatically?: { ... }\n journey_submission_required?: { ... }\n context_parameters?: { ... }\n ai_prefill?: { ... }\n }\n }\n partner?: {\n enabled?: boolean\n label?: string\n description?: string\n }\n enabled?: boolean\n requirements?: Array<{\n definitionId: string\n type: "STEP" | "SECTION"\n condition: "CLOSED"\n }>\n executionType?: "MANUAL" | "AUTOMATION"\n sectionId?: string\n executionId?: string\n userIds?: number[]\n assignedTo?: string[]\n assignedToInProgress?: string\n assignedToOnHold?: string\n status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n created?: string\n lastUpdated?: string\n statusLastUpdated?: string\n startedTime?: string\n completedTime?: string\n dueDate?: string\n dynamicDueDate?: {\n numberOfUnits: number\n timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"\n actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"\n stepId?: string\n phaseId?: string\n }\n manuallyCreated?: boolean\n automationConfig?: {\n flowId: string\n executionId?: string\n executionStatus?: string\n }\n journey?: {\n id?: string\n journeyId?: string\n name?: string\n portal_button_label?: string\n complete_task_automatically?: boolean\n journey_submission_required?: boolean\n context_parameters?: Array<{\n key: { ... }\n value: { ... }\n }>\n ai_prefill?: {\n enabled?: { ... }\n source?: { ... }\n extraction_fields?: { ... }\n mappings?: { ... }\n min_confidence?: { ... }\n instructions?: { ... }\n }\n }\n taxonomies?: string[]\n}\n```\n\n### `SearchStepsResp`\n\n```ts\ntype SearchStepsResp = {\n hits?: number\n results?: Array<{\n executionId: string\n executionName: string\n executionStatus: "STARTED" | "DONE" | "CLOSED"\n contexts?: Array<{\n id: { ... }\n title: { ... }\n schema: { ... }\n }>\n }>\n}\n```\n\n### `SearchExecutionsReq`\n\n```ts\ntype SearchExecutionsReq = {\n name?: string\n status?: "STARTED" | "DONE" | "CLOSED"\n includeDoneWorkflows?: boolean\n assignedTo?: string\n sorting?: "A_Z" | "Z_A" | "DUE_DATE_ASC" | "DUE_DATE_DESC" | "TRIGGER_DATE_ASC" | "TRIGGER_DATE_DESC"\n pagination?: {\n orgId?: string\n creationTime?: string\n }\n}\n```\n\n### `SearchExecutionsResp`\n\n```ts\ntype SearchExecutionsResp = {\n executions: Array<{\n id?: string\n definitionId?: string\n orgId?: string\n name?: string\n creationTime?: string\n lastUpdateTime?: string\n dueDate?: string\n completedTime?: string\n dynamicDueDate?: {\n numberOfUnits: { ... }\n timePeriod: { ... }\n actionTypeCondition?: { ... }\n stepId?: { ... }\n phaseId?: { ... }\n }\n status?: "STARTED" | "DONE" | "CLOSED"\n trigger?: "MANUAL" | "AUTOMATIC"\n assignedTo?: string[]\n lastModifiedBy?: string\n contexts?: Array<{\n id: { ... }\n title: { ... }\n schema: { ... }\n }>\n nextOpenStep?: {\n id?: { ... }\n entityRefId?: { ... }\n }\n configuredClosingReasonSnapshot?: Array<{\n id: { ... }\n title: { ... }\n }>\n selectedClosingReasons?: Array<{\n id: { ... }\n title: { ... }\n }>\n closingReasonDescription?: string\n enableECPWorkflow?: boolean\n updateEntityAttributes?: Array<{\n source: { ... }\n target: { ... }\n }>\n version?: number\n taxonomies?: string[]\n singleClosingReasonSelection?: boolean\n flow: Array<{\n id: { ... }\n definitionId?: { ... }\n name: { ... }\n userIds?: { ... }\n assignedTo?: { ... }\n dueDate?: { ... }\n dynamicDueDate?: { ... }\n startedTime?: { ... }\n completedTime?: { ... }\n status?: { ... }\n type: { ... }\n steps: { ... }\n taxonomies?: { ... }\n } | {\n id: { ... }\n definitionId?: { ... }\n entityRefId?: { ... }\n name: { ... }\n description?: { ... }\n type: { ... }\n ecp?: { ... }\n installer?: { ... }\n partner?: { ... }\n enabled?: { ... }\n requirements?: { ... }\n executionType?: { ... }\n sectionId?: { ... }\n executionId?: { ... }\n userIds?: { ... }\n assignedTo?: { ... }\n assignedToInProgress?: { ... }\n assignedToOnHold?: { ... }\n status?: { ... }\n created?: { ... }\n lastUpdated?: { ... }\n statusLastUpdated?: { ... }\n startedTime?: { ... }\n completedTime?: { ... }\n dueDate?: { ... }\n dynamicDueDate?: { ... }\n manuallyCreated?: { ... }\n automationConfig?: { ... }\n journey?: { ... }\n taxonomies?: { ... }\n }>\n }>\n lastEvaluatedKey?: {\n orgId?: string\n creationTime?: string\n }\n}\n```\n\n### `LastEvaluatedKey`\n\n```ts\ntype LastEvaluatedKey = {\n orgId?: string\n creationTime?: string\n}\n```\n\n### `SearchStepsReq`\n\n```ts\ntype SearchStepsReq = {\n executionName?: string\n stepName?: string\n assignedTo?: number\n includeDoneWorkflows?: boolean\n manuallyCreated?: boolean\n status?: "OPEN" | "COMPLETE" | "NEXT_OPEN_ITEM_IN_WORKFLOW"\n sorting?: "A_Z" | "Z_A" | "DUE_DATE_ASC" | "DUE_DATE_DESC" | "TRIGGER_DATE_ASC" | "TRIGGER_DATE_DESC"\n pagination?: {\n from?: number\n size?: number\n }\n}\n```\n\n### `SearchSorting`\n\n```ts\ntype SearchSorting = "A_Z" | "Z_A" | "DUE_DATE_ASC" | "DUE_DATE_DESC" | "TRIGGER_DATE_ASC" | "TRIGGER_DATE_DESC"\n```\n\n### `SearchPagination`\n\n```ts\ntype SearchPagination = {\n from?: number\n size?: number\n}\n```\n\n### `ExecutionPaginationDynamo`\n\n```ts\ntype ExecutionPaginationDynamo = {\n orgId?: string\n creationTime?: string\n}\n```\n\n### `ErrorResp`\n\nStandard error response returned when an API request fails.\nContains a human-readable message describing the error.\n\n\n```ts\ntype ErrorResp = {\n message: string\n}\n```\n\n### `ClosingReasonResp`\n\n```ts\ntype ClosingReasonResp = {\n reasons?: Array<{\n id: string\n title: string\n }>\n}\n```\n\n### `PhaseInEntity`\n\n```ts\ntype PhaseInEntity = {\n phase_id?: string\n phase_name?: string\n phase_progress?: number\n phase_assignees?: string[]\n}\n```\n\n### `TaskInEntity`\n\n```ts\ntype TaskInEntity = {\n task_id?: string\n task_name?: string\n task_assignees?: string[]\n task_duedate?: string // date-time\n task_start_date?: string\n task_execution_type?: "MANUAL" | "AUTOMATION"\n task_status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n}\n```\n\n### `WorkflowInEntity`\n\n```ts\ntype WorkflowInEntity = {\n id?: string\n definition_id?: string\n name?: string\n status?: "STARTED" | "DONE" | "CLOSED"\n assignees?: string[]\n duedate?: string // date-time\n last_update_time?: string // date-time\n progress?: number\n upcoming_tasks_assignees?: string[]\n task_id?: string\n task_name?: string\n task_assignees?: string[]\n task_duedate?: string // date-time\n task_start_date?: string\n task_execution_type?: "MANUAL" | "AUTOMATION"\n task_status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n current_tasks?: Array<{\n task_id?: string\n task_name?: string\n task_assignees?: string[]\n task_duedate?: string // date-time\n task_start_date?: string\n task_execution_type?: "MANUAL" | "AUTOMATION"\n task_status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n }>\n phase_id?: string\n phase_name?: string\n phase_assignees?: string[]\n phase_progress?: number\n phases_in_progress?: Array<{\n phase_id?: string\n phase_name?: string\n phase_progress?: number\n phase_assignees?: string[]\n }>\n selected_closing_reasons?: Array<{\n id: string\n title: string\n }>\n closing_reason_description?: string\n}\n```\n\n### `UpdateEntityAttributes`\n\n```ts\ntype UpdateEntityAttributes = {\n source: "workflow_status" | "current_section" | "current_step"\n target: {\n entitySchema: string\n entityAttribute: string\n }\n}\n```\n\n### `EntitySync`\n\n```ts\ntype EntitySync = {\n trigger: {\n event: "FlowStarted" | "FlowCompleted" | "FlowCancelled" | "FlowReopened" | "FlowDeleted" | "FlowAssigned" | "FlowDueDateChanged" | "FlowContextsChanged" | "TaskUpdated" | "CurrTaskChanged" | "TaskCompleted" | "TaskSkipped" | "TaskMarkedInProgress" | "TaskMarkedOnHold" | "PhaseUpdated" | "PhaseCompleted" | "PhaseSkipped" | "PhaseMarkedInProgress"\n filter?: {\n task_template_id?: { ... }\n phase_template_id?: { ... }\n }\n }\n value: {\n source: "workflow_name" | "workflow_status" | "workflow_assigned_to" | "task_name" | "task_status" | "task_assigned_to" | "phase_name" | "phase_status" | "phase_assigned_to" | "custom_value"\n value?: string\n }\n target: {\n entitySchema: string\n entityAttribute: string\n }\n}\n```\n\n### `DynamicDueDate`\n\nset a Duedate for a step then a specific\n\n```ts\ntype DynamicDueDate = {\n numberOfUnits: number\n timePeriod: "minutes" | "hours" | "days" | "weeks" | "months"\n actionTypeCondition?: "WORKFLOW_STARTED" | "STEP_CLOSED" | "PHASE_FINISHED"\n stepId?: string\n phaseId?: string\n}\n```\n\n### `StepRequirement`\n\ndescribe the requirement for step enablement\n\n```ts\ntype StepRequirement = {\n definitionId: string\n type: "STEP" | "SECTION"\n condition: "CLOSED"\n}\n```\n\n### `StartFlowReq`\n\nRequest payload for starting a new flow execution from a template.\n\n\n```ts\ntype StartFlowReq = {\n flow_template_id: string\n trigger?: {\n type?: "MANUAL" | "AUTOMATIC"\n automation_config?: {\n flow_id: { ... }\n execution_id?: { ... }\n execution_status?: { ... }\n error_reason?: { ... }\n input_context?: { ... }\n output_context?: { ... }\n heal_attempts?: { ... }\n run_for_user_id?: { ... }\n last_heal_attempted_at?: { ... }\n wait_for_journey_submission?: { ... }\n journey_id?: { ... }\n journey_execution?: { ... }\n eligible_closing_reason_ids?: { ... }\n allow_execution_note?: { ... }\n email_review?: { ... }\n }\n trigger_id?: string\n }\n contexts: Array<{\n entity_id?: string\n entity_schema?: string\n is_primary?: boolean\n promoted_by_task_id?: string\n promoted_at?: string // date-time\n demoted_by_task_id?: string\n added_by_task_id?: string\n }>\n purposes?: string[]\n}\n```\n\n### `SearchFlowsReq`\n\n```ts\ntype SearchFlowsReq = {\n entity_id: string\n entity_schema: string\n include_background?: boolean\n}\n```\n\n### `PortalWorkflowsSearchReq`\n\n```ts\ntype PortalWorkflowsSearchReq = {\n entity_id: string\n entity_schema: string\n audience: "ecp" | "installer" | "all"\n}\n```\n\n### `PortalAudience`\n\nWhich portal audience the workflows are loaded for. Controls which task-level\nportal config (`ecp` or `installer`) determines task visibility. `all` returns\ntasks enabled for any audience \u2014 callers must state the widest scope explicitly\nrather than falling into it by omission.\n\n\n```ts\ntype PortalAudience = "ecp" | "installer" | "all"\n```\n\n### `PortalWorkflowsSearchResp`\n\n```ts\ntype PortalWorkflowsSearchResp = {\n workflows: Array<{\n id: string\n definition_id?: string\n name: string\n status: "STARTED" | "DONE" | "CLOSED"\n version: 2 | 3\n created_at?: string\n updated_at?: string\n completed_at?: string\n due_date?: string\n assigned_to?: string[]\n contexts?: Array<{\n entity_id?: { ... }\n entity_schema?: { ... }\n is_primary?: { ... }\n promoted_by_task_id?: { ... }\n promoted_at?: { ... }\n demoted_by_task_id?: { ... }\n added_by_task_id?: { ... }\n }>\n is_path_complete: boolean\n tasks?: Array<{\n id: { ... }\n name: { ... }\n status: { ... }\n is_active: { ... }\n start_date?: { ... }\n ecp?: { ... }\n installer?: { ... }\n journey?: { ... }\n assigned_to?: { ... }\n phase_id?: { ... }\n phase_name?: { ... }\n stage_id?: { ... }\n completed_at?: { ... }\n updated_at?: { ... }\n }>\n stages?: Array<{\n id: { ... }\n name: { ... }\n description?: { ... }\n status: { ... }\n completed_at?: { ... }\n portal_names?: { ... }\n portal_descriptions?: { ... }\n }>\n portal_titles?: {\n ecp?: { ... }\n installer?: { ... }\n }\n }>\n}\n```\n\n### `BulkStartFlowsReq`\n\nStart every flow in `flow_template_ids` on every entity in `entities`.\n\n```ts\ntype BulkStartFlowsReq = {\n flow_template_ids: string[]\n entities: Array<{\n entity_id: string\n entity_schema: string\n }>\n purposes?: string[]\n}\n```\n\n### `BulkStartEntityRef`\n\n```ts\ntype BulkStartEntityRef = {\n entity_id: string\n entity_schema: string\n}\n```\n\n### `BulkStartFlowsJobStatus`\n\n* `awaiting_approval`: preflight done, nothing started; waits for `APPROVE`\n* `queued`: approved, waiting for a worker\n* `running`: starts in progress\n* `completed`: every start that was not skipped succeeded\n* `completed_with_errors`: finished, at least one start failed\n* `failed`: the job itself f\n\n```ts\ntype BulkStartFlowsJobStatus = "awaiting_approval" | "queued" | "running" | "completed" | "completed_with_errors" | "failed" | "cancelled" | "expired"\n```\n\n### `BulkStartFlowsItemStatus`\n\n```ts\ntype BulkStartFlowsItemStatus = "pending" | "started" | "failed" | "skipped" | "cancelled"\n```\n\n### `BulkStartFlowsItem`\n\nOne (flow, entity) start of a bulk-start job.\n\n```ts\ntype BulkStartFlowsItem = {\n flow_template_id: string\n entity_id: string\n entity_schema: string\n status: "pending" | "started" | "failed" | "skipped" | "cancelled"\n execution_id?: string\n error_code?: string\n error_message?: string\n updated_at?: string // date-time\n}\n```\n\n### `BulkStartFlowsFlowSummary`\n\n```ts\ntype BulkStartFlowsFlowSummary = {\n flow_template_id: string\n flow_name: string\n will_start: number\n skipped: number\n}\n```\n\n### `BulkStartFlowsJobCounts`\n\n```ts\ntype BulkStartFlowsJobCounts = {\n total: number\n pending: number\n started: number\n failed: number\n skipped: number\n cancelled: number\n}\n```\n\n### `BulkStartFlowsJob`\n\n```ts\ntype BulkStartFlowsJob = {\n job_id: string\n org_id: string\n status: "awaiting_approval" | "queued" | "running" | "completed" | "completed_with_errors" | "failed" | "cancelled" | "expired"\n created_by: string\n created_at: string // date-time\n updated_at: string // date-time\n expires_at: string // date-time\n approved_at?: string // date-time\n approved_by?: string\n finished_at?: string // date-time\n cancel_requested?: boolean\n restart_of?: string\n restarted_by?: string\n flows: Array<{\n flow_template_id: string\n flow_name: string\n will_start: number\n skipped: number\n }>\n counts: {\n total: number\n pending: number\n started: number\n failed: number\n skipped: number\n cancelled: number\n }\n items: Array<{\n flow_template_id: string\n entity_id: string\n entity_schema: string\n status: "pending" | "started" | "failed" | "skipped" | "cancelled"\n execution_id?: string\n error_code?: string\n error_message?: string\n updated_at?: string // date-time\n }>\n}\n```\n\n### `BulkStartFlowsJobSummary`\n\nA bulk-start job as listed in the history, without its items.\n\n```ts\ntype BulkStartFlowsJobSummary = {\n job_id: string\n org_id: string\n status: "awaiting_approval" | "queued" | "running" | "completed" | "completed_with_errors" | "failed" | "cancelled" | "expired"\n created_by: string\n created_by_org_id?: string\n created_at: string // date-time\n updated_at: string // date-time\n expires_at: string // date-time\n approved_at?: string // date-time\n approved_by?: string\n finished_at?: string // date-time\n cancel_requested?: boolean\n restart_of?: string\n restarted_by?: string\n flows: Array<{\n flow_template_id: string\n flow_name: string\n will_start: number\n skipped: number\n }>\n entity_schema?: string\n entity_ids: string[]\n entity_count: number\n counts: {\n total: number\n pending: number\n started: number\n failed: number\n skipped: number\n cancelled: number\n }\n}\n```\n\n### `ListBulkStartFlowsJobsResp`\n\n```ts\ntype ListBulkStartFlowsJobsResp = {\n results: Array<{\n job_id: string\n org_id: string\n status: "awaiting_approval" | "queued" | "running" | "completed" | "completed_with_errors" | "failed" | "cancelled" | "expired"\n created_by: string\n created_by_org_id?: string\n created_at: string // date-time\n updated_at: string // date-time\n expires_at: string // date-time\n approved_at?: string // date-time\n approved_by?: string\n finished_at?: string // date-time\n cancel_requested?: boolean\n restart_of?: string\n restarted_by?: string\n flows: Array<{\n flow_template_id: { ... }\n flow_name: { ... }\n will_start: { ... }\n skipped: { ... }\n }>\n entity_schema?: string\n entity_ids: string[]\n entity_count: number\n counts: {\n total: { ... }\n pending: { ... }\n started: { ... }\n failed: { ... }\n skipped: { ... }\n cancelled: { ... }\n }\n }>\n next_cursor?: string\n}\n```\n\n### `ActiveBulkStartFlowsJobResp`\n\n```ts\ntype ActiveBulkStartFlowsJobResp = {\n job: {\n job_id: string\n org_id: string\n status: "awaiting_approval" | "queued" | "running" | "completed" | "completed_with_errors" | "failed" | "cancelled" | "expired"\n created_by: string\n created_at: string // date-time\n updated_at: string // date-time\n expires_at: string // date-time\n approved_at?: string // date-time\n approved_by?: string\n finished_at?: string // date-time\n cancel_requested?: boolean\n restart_of?: string\n restarted_by?: string\n flows: Array<{\n flow_template_id: { ... }\n flow_name: { ... }\n will_start: { ... }\n skipped: { ... }\n }>\n counts: {\n total: { ... }\n pending: { ... }\n started: { ... }\n failed: { ... }\n skipped: { ... }\n cancelled: { ... }\n }\n items: Array<{\n flow_template_id: { ... }\n entity_id: { ... }\n entity_schema: { ... }\n status: { ... }\n execution_id?: { ... }\n error_code?: { ... }\n error_message?: { ... }\n updated_at?: { ... }\n }>\n }\n}\n```\n\n### `PatchBulkStartFlowsJobReq`\n\n```ts\ntype PatchBulkStartFlowsJobReq = {\n action: "APPROVE" | "CANCEL"\n}\n```\n\n### `PortalWorkflowsBatchSearchReq`\n\n```ts\ntype PortalWorkflowsBatchSearchReq = {\n entities: Array<{\n entity_id: string\n entity_schema: string\n }>\n audience: "ecp" | "installer" | "all"\n}\n```\n\n### `PortalEntityRef`\n\n```ts\ntype PortalEntityRef = {\n entity_id: string\n entity_schema: string\n}\n```\n\n### `PortalWorkflowsBatchSearchResp`\n\n```ts\ntype PortalWorkflowsBatchSearchResp = {\n results: Array<{\n entity_id: string\n workflows: Array<{\n id: { ... }\n definition_id?: { ... }\n name: { ... }\n status: { ... }\n version: { ... }\n created_at?: { ... }\n updated_at?: { ... }\n completed_at?: { ... }\n due_date?: { ... }\n assigned_to?: { ... }\n contexts?: { ... }\n is_path_complete: { ... }\n tasks?: { ... }\n stages?: { ... }\n portal_titles?: { ... }\n }>\n }>\n}\n```\n\n### `EntityPortalWorkflows`\n\nLinearized portal workflows of a single entity\n\n```ts\ntype EntityPortalWorkflows = {\n entity_id: string\n workflows: Array<{\n id: string\n definition_id?: string\n name: string\n status: "STARTED" | "DONE" | "CLOSED"\n version: 2 | 3\n created_at?: string\n updated_at?: string\n completed_at?: string\n due_date?: string\n assigned_to?: string[]\n contexts?: Array<{\n entity_id?: { ... }\n entity_schema?: { ... }\n is_primary?: { ... }\n promoted_by_task_id?: { ... }\n promoted_at?: { ... }\n demoted_by_task_id?: { ... }\n added_by_task_id?: { ... }\n }>\n is_path_complete: boolean\n tasks?: Array<{\n id: { ... }\n name: { ... }\n status: { ... }\n is_active: { ... }\n start_date?: { ... }\n ecp?: { ... }\n installer?: { ... }\n journey?: { ... }\n assigned_to?: { ... }\n phase_id?: { ... }\n phase_name?: { ... }\n stage_id?: { ... }\n completed_at?: { ... }\n updated_at?: { ... }\n }>\n stages?: Array<{\n id: { ... }\n name: { ... }\n description?: { ... }\n status: { ... }\n completed_at?: { ... }\n portal_names?: { ... }\n portal_descriptions?: { ... }\n }>\n portal_titles?: {\n ecp?: { ... }\n installer?: { ... }\n }\n }>\n}\n```\n\n### `PortalWorkflow`\n\nA portal-facing projection of a workflow execution (V1 or V2), with the execution\ngraph already linearized into a flat, ordered list of portal-visible steps.\n\n\n```ts\ntype PortalWorkflow = {\n id: string\n definition_id?: string\n name: string\n status: "STARTED" | "DONE" | "CLOSED"\n version: 2 | 3\n created_at?: string\n updated_at?: string\n completed_at?: string\n due_date?: string\n assigned_to?: string[]\n contexts?: Array<{\n entity_id?: string\n entity_schema?: string\n is_primary?: boolean\n promoted_by_task_id?: string\n promoted_at?: string // date-time\n demoted_by_task_id?: string\n added_by_task_id?: string\n }>\n is_path_complete: boolean\n tasks?: Array<{\n id: string\n name: string\n status: "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "PENDING"\n is_active: boolean\n start_date?: string\n ecp?: {\n enabled?: { ... }\n label?: { ... }\n description?: { ... }\n journey?: { ... }\n }\n installer?: {\n enabled?: { ... }\n label?: { ... }\n description?: { ... }\n journey?: { ... }\n }\n journey?: {\n id?: { ... }\n journeyId?: { ... }\n name?: { ... }\n portal_button_label?: { ... }\n complete_task_automatically?: { ... }\n journey_submission_required?: { ... }\n context_parameters?: { ... }\n ai_prefill?: { ... }\n }\n assigned_to?: string[]\n phase_id?: string\n phase_name?: string\n stage_id?: string\n completed_at?: string\n updated_at?: string\n }>\n stages?: Array<{\n id: string\n name: string\n description?: string\n status: "COMPLETED" | "IN_PROGRESS" | "UPCOMING" | "NOT_REACHED"\n completed_at?: string\n portal_names?: {\n ecp?: { ... }\n installer?: { ... }\n }\n portal_descriptions?: {\n ecp?: { ... }\n installer?: { ... }\n }\n }>\n portal_titles?: {\n ecp?: string\n installer?: string\n }\n}\n```\n\n### `PortalWorkflowTask`\n\nA single portal-visible step of a linearized workflow execution\n\n```ts\ntype PortalWorkflowTask = {\n id: string\n name: string\n status: "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "PENDING"\n is_active: boolean\n start_date?: string\n ecp?: {\n enabled?: boolean\n label?: string\n description?: string\n journey?: {\n id?: { ... }\n journeyId?: { ... }\n name?: { ... }\n portal_button_label?: { ... }\n complete_task_automatically?: { ... }\n journey_submission_required?: { ... }\n context_parameters?: { ... }\n ai_prefill?: { ... }\n }\n }\n installer?: {\n enabled?: boolean\n label?: string\n description?: string\n journey?: {\n id?: { ... }\n journeyId?: { ... }\n name?: { ... }\n portal_button_label?: { ... }\n complete_task_automatically?: { ... }\n journey_submission_required?: { ... }\n context_parameters?: { ... }\n ai_prefill?: { ... }\n }\n }\n journey?: {\n id?: string\n journeyId?: string\n name?: string\n portal_button_label?: string\n complete_task_automatically?: boolean\n journey_submission_required?: boolean\n context_parameters?: Array<{\n key: { ... }\n value: { ... }\n }>\n ai_prefill?: {\n enabled?: { ... }\n source?: { ... }\n extraction_fields?: { ... }\n mappings?: { ... }\n min_confidence?: { ... }\n instructions?: { ... }\n }\n }\n assigned_to?: string[]\n phase_id?: string\n phase_name?: string\n stage_id?: string\n completed_at?: string\n updated_at?: string\n}\n```\n\n### `PortalWorkflowStage`\n\nA customer-facing stage of a flow execution as shown in portals, with a progress status derived from the execution\'s tasks. Stages form a strict total order; the array order is the stage order.\n\n```ts\ntype PortalWorkflowStage = {\n id: string\n name: string\n description?: string\n status: "COMPLETED" | "IN_PROGRESS" | "UPCOMING" | "NOT_REACHED"\n completed_at?: string\n portal_names?: {\n ecp?: string\n installer?: string\n }\n portal_descriptions?: {\n ecp?: string\n installer?: string\n }\n}\n```\n\n### `PatchFlowReq`\n\n```ts\ntype PatchFlowReq = {\n status?: "STARTED" | "DONE" | "CLOSED"\n assigned_to?: Array<string | {\n variable: string\n value?: string[]\n }>\n closing_reason?: {\n selected_reasons?: Array<{\n id: { ... }\n title: { ... }\n }>\n configured_reasons?: Array<{\n id: { ... }\n title: { ... }\n }>\n extra_description?: string\n }\n due_date?: string\n due_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "START_DATE"\n task_id?: string\n phase_id?: string\n }\n contexts?: Array<{\n entity_id?: string\n entity_schema?: string\n is_primary?: boolean\n promoted_by_task_id?: string\n promoted_at?: string // date-time\n demoted_by_task_id?: string\n added_by_task_id?: string\n }>\n visibility?: "entity_views" | "background"\n visible_on?: Array<{\n entity_id: string\n entity_schema?: string\n kind: "context" | "display"\n anchor_entity_id?: string\n rule_id?: string\n }>\n}\n```\n\n### `FlowExecution`\n\n```ts\ntype FlowExecution = {\n id: string\n loop_source?: "loops" | "loop_config"\n flow_template_id: string\n org_id: string\n name: string\n created_at: string\n updated_at: string\n due_date?: string\n due_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "START_DATE"\n task_id?: string\n phase_id?: string\n }\n status: "STARTED" | "DONE" | "CLOSED"\n assigned_to?: Array<string | {\n variable: string\n value?: string[]\n }>\n analytics: {\n started_at?: string\n completed_at?: string\n closed_at?: string\n started_by?: string\n started_by_org_id?: string\n closed_by?: string\n completed_by?: string\n }\n contexts: Array<{\n entity_id?: string\n entity_schema?: string\n is_primary?: boolean\n promoted_by_task_id?: string\n promoted_at?: string // date-time\n demoted_by_task_id?: string\n added_by_task_id?: string\n }>\n visibility?: "entity_views" | "background"\n visible_on?: Array<{\n entity_id: string\n entity_schema?: string\n kind: "context" | "display"\n anchor_entity_id?: string\n rule_id?: string\n }>\n crt_tasks: Array<{\n id?: string\n crt_since?: string // date-time\n }>\n phases?: Array<{\n id: string\n template_id: string\n name: string\n status?: "OPEN" | "IN_PROGRESS" | "COMPLETED"\n updated_at?: string\n due_date?: string\n due_date_config?: {\n duration: { ... }\n unit: { ... }\n type: { ... }\n task_id?: { ... }\n phase_id?: { ... }\n }\n assigned_to?: Array<string | {\n variable: { ... }\n value?: { ... }\n }>\n analytics?: {\n started_at?: { ... }\n in_progress_at?: { ... }\n completed_at?: { ... }\n status_updated_at?: { ... }\n in_progress_by?: { ... }\n completed_by?: { ... }\n skipped_at?: { ... }\n skipped_by?: { ... }\n on_hold_by?: { ... }\n }\n taxonomies?: string[]\n loop_config?: {\n max_iterations: { ... }\n crt_iterations?: { ... }\n }\n loop_membership?: Array<{\n loop_id: { ... }\n runs_in_loop: { ... }\n }>\n }>\n stages?: Array<{\n id: string\n name: string\n description?: string\n entry_node_id?: string\n cut_edge_ids?: string[]\n color?: string\n portal_names?: {\n ecp?: { ... }\n installer?: { ... }\n // ...\n}\n```\n\n### `FlowClosingReason`\n\n```ts\ntype FlowClosingReason = {\n selected_reasons?: Array<{\n id: string\n title: string\n }>\n configured_reasons?: Array<{\n id: string\n title: string\n }>\n extra_description?: string\n}\n```\n\n### `FlowTrigger`\n\n```ts\ntype FlowTrigger = {\n type?: "MANUAL" | "AUTOMATIC"\n automation_config?: {\n flow_id: string\n execution_id?: string\n execution_status?: string\n error_reason?: string\n input_context?: {\n source: { ... }\n task_id?: { ... }\n trigger_id?: { ... }\n with_relations?: { ... }\n also_pass?: { ... }\n }\n output_context?: {\n set_as_primary?: { ... }\n attach_to_contexts?: { ... }\n }\n heal_attempts?: number\n run_for_user_id?: string\n last_heal_attempted_at?: string // date-time\n wait_for_journey_submission?: boolean\n journey_id?: string\n journey_execution?: {\n execution_id?: { ... }\n execution_status?: { ... }\n error_reason?: { ... }\n submission_entity_id?: { ... }\n submission_created_at?: { ... }\n wait_overridden_at?: { ... }\n wait_overridden_by?: { ... }\n }\n eligible_closing_reason_ids?: string[]\n allow_execution_note?: boolean\n email_review?: {\n enabled?: { ... }\n allow_document_selection?: { ... }\n allow_subject_and_body_edit?: { ... }\n }\n }\n trigger_id?: string\n}\n```\n\n### `ConfiguredTrigger`\n\nOne configured trigger of the flow template, snapshotted VERBATIM onto the execution at start \u2014 conceptually the workflow-definition API\'s `Trigger` schema plus the `primary` flag. The trigger schema is owned by the definition service and copied through opaquely, so only the fields consumers key on \n\n```ts\ntype ConfiguredTrigger = {\n id?: string\n type?: string\n primary?: boolean\n entity_schema?: string\n automation_id?: string\n journey_id?: string\n}\n```\n\n### `VisibleEntity`\n\nOne entity a run is SHOWN on. Distinct from a context: a context is what the run reads, writes and decides against, while this only decides where people see it. Every context that is displayed also appears here.\n\n```ts\ntype VisibleEntity = {\n entity_id: string\n entity_schema?: string\n kind: "context" | "display"\n anchor_entity_id?: string\n rule_id?: string\n}\n```\n\n### `FlowContext`\n\n```ts\ntype FlowContext = {\n entity_id?: string\n entity_schema?: string\n is_primary?: boolean\n promoted_by_task_id?: string\n promoted_at?: string // date-time\n demoted_by_task_id?: string\n added_by_task_id?: string\n}\n```\n\n### `EntityRef`\n\nOne entity a run is bound to. `entity_id` is the identity of a context: a run never holds two contexts with the same `entity_id`.\n\n```ts\ntype EntityRef = {\n entity_id?: string\n entity_schema?: string\n is_primary?: boolean\n promoted_by_task_id?: string\n promoted_at?: string // date-time\n demoted_by_task_id?: string\n added_by_task_id?: string\n}\n```\n\n### `PhaseId`\n\n```ts\ntype PhaseId = string\n```\n\n### `TaskId`\n\n```ts\ntype TaskId = string\n```\n\n### `Task`\n\n```ts\ntype Task = {\n id: string\n loop_membership?: Array<{\n loop_id: string\n runs_in_loop: boolean\n }>\n template_id: string\n name: string\n description?: {\n enabled?: boolean\n value?: string\n }\n status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n journey?: {\n id?: string\n journeyId?: string\n name?: string\n portal_button_label?: string\n complete_task_automatically?: boolean\n journey_submission_required?: boolean\n context_parameters?: Array<{\n key: { ... }\n value: { ... }\n }>\n ai_prefill?: {\n enabled?: { ... }\n source?: { ... }\n extraction_fields?: { ... }\n mappings?: { ... }\n min_confidence?: { ... }\n instructions?: { ... }\n }\n }\n journey_prefill?: {\n status: "PENDING" | "READY" | "FAILED" | "SKIPPED"\n agent_execution_id?: string\n dispatched_at?: string // date-time\n extracted_at?: string // date-time\n initial_state?: Record<string, unknown>\n field_confidence?: Record<string, number>\n dropped?: Array<{\n source?: { ... }\n block_id?: { ... }\n reason: { ... }\n }>\n }\n due_date?: string\n due_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "START_DATE"\n task_id?: string\n phase_id?: string\n }\n start_date?: string\n start_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "THIS_TASK_LAST_COMPLETED"\n task_id?: string\n }\n requirements?: Array<{\n task_id?: string\n phase_id?: string\n when: "TASK_FINISHED" | "PHASE_FINISHED"\n }>\n required?: boolean\n subtasks?: Array<{\n id: string\n name?: string\n party: "description" | "ecp" | "installer" | "partner"\n required?: boolean\n }>\n subtask_states?: Record<string, {\n completed: boolean\n completed_by?: string\n completed_at?: string // date-time\n }>\n journey_submission?: {\n submission_entity_id?: string\n submitted_at?: string // date-time\n }\n completion_gates_reset_at?: string // date-time\n journey_gate_waived_at?: string // date-time\n assigned_to?: Array<string | {\n variable: string\n value?: string[]\n }>\n ecp_placeholder_assignees?: {\n placeholder_ecp_customers?: string[]\n placeholder_ecp_installers?: string[]\n }\n analytics: {\n started_at?: string // date-time\n in_progress_at?: string // date-time\n completed_at?: string // date-time\n status_updated_at?: string // date-time\n in_progress_by?: string\n completed_by?: string\n skipped_at?: string // date-time\n // ...\n}\n```\n\n### `TaskType`\n\n```ts\ntype TaskType = "MANUAL" | "AUTOMATION" | "DECISION" | "AI_AGENT"\n```\n\n### `ManualTask`\n\n```ts\ntype ManualTask = {\n id: string\n loop_membership?: Array<{\n loop_id: string\n runs_in_loop: boolean\n }>\n template_id: string\n name: string\n description?: {\n enabled?: boolean\n value?: string\n }\n status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n journey?: {\n id?: string\n journeyId?: string\n name?: string\n portal_button_label?: string\n complete_task_automatically?: boolean\n journey_submission_required?: boolean\n context_parameters?: Array<{\n key: { ... }\n value: { ... }\n }>\n ai_prefill?: {\n enabled?: { ... }\n source?: { ... }\n extraction_fields?: { ... }\n mappings?: { ... }\n min_confidence?: { ... }\n instructions?: { ... }\n }\n }\n journey_prefill?: {\n status: "PENDING" | "READY" | "FAILED" | "SKIPPED"\n agent_execution_id?: string\n dispatched_at?: string // date-time\n extracted_at?: string // date-time\n initial_state?: Record<string, unknown>\n field_confidence?: Record<string, number>\n dropped?: Array<{\n source?: { ... }\n block_id?: { ... }\n reason: { ... }\n }>\n }\n due_date?: string\n due_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "START_DATE"\n task_id?: string\n phase_id?: string\n }\n start_date?: string\n start_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "THIS_TASK_LAST_COMPLETED"\n task_id?: string\n }\n requirements?: Array<{\n task_id?: string\n phase_id?: string\n when: "TASK_FINISHED" | "PHASE_FINISHED"\n }>\n required?: boolean\n subtasks?: Array<{\n id: string\n name?: string\n party: "description" | "ecp" | "installer" | "partner"\n required?: boolean\n }>\n subtask_states?: Record<string, {\n completed: boolean\n completed_by?: string\n completed_at?: string // date-time\n }>\n journey_submission?: {\n submission_entity_id?: string\n submitted_at?: string // date-time\n }\n completion_gates_reset_at?: string // date-time\n journey_gate_waived_at?: string // date-time\n assigned_to?: Array<string | {\n variable: string\n value?: string[]\n }>\n ecp_placeholder_assignees?: {\n placeholder_ecp_customers?: string[]\n placeholder_ecp_installers?: string[]\n }\n analytics: {\n started_at?: string // date-time\n in_progress_at?: string // date-time\n completed_at?: string // date-time\n status_updated_at?: string // date-time\n in_progress_by?: string\n completed_by?: string\n skipped_at?: string // date-time\n // ...\n}\n```\n\n### `AutomationTask`\n\n```ts\ntype AutomationTask = {\n id: string\n loop_membership?: Array<{\n loop_id: string\n runs_in_loop: boolean\n }>\n template_id: string\n name: string\n description?: {\n enabled?: boolean\n value?: string\n }\n status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n journey?: {\n id?: string\n journeyId?: string\n name?: string\n portal_button_label?: string\n complete_task_automatically?: boolean\n journey_submission_required?: boolean\n context_parameters?: Array<{\n key: { ... }\n value: { ... }\n }>\n ai_prefill?: {\n enabled?: { ... }\n source?: { ... }\n extraction_fields?: { ... }\n mappings?: { ... }\n min_confidence?: { ... }\n instructions?: { ... }\n }\n }\n journey_prefill?: {\n status: "PENDING" | "READY" | "FAILED" | "SKIPPED"\n agent_execution_id?: string\n dispatched_at?: string // date-time\n extracted_at?: string // date-time\n initial_state?: Record<string, unknown>\n field_confidence?: Record<string, number>\n dropped?: Array<{\n source?: { ... }\n block_id?: { ... }\n reason: { ... }\n }>\n }\n due_date?: string\n due_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "START_DATE"\n task_id?: string\n phase_id?: string\n }\n start_date?: string\n start_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "THIS_TASK_LAST_COMPLETED"\n task_id?: string\n }\n requirements?: Array<{\n task_id?: string\n phase_id?: string\n when: "TASK_FINISHED" | "PHASE_FINISHED"\n }>\n required?: boolean\n subtasks?: Array<{\n id: string\n name?: string\n party: "description" | "ecp" | "installer" | "partner"\n required?: boolean\n }>\n subtask_states?: Record<string, {\n completed: boolean\n completed_by?: string\n completed_at?: string // date-time\n }>\n journey_submission?: {\n submission_entity_id?: string\n submitted_at?: string // date-time\n }\n completion_gates_reset_at?: string // date-time\n journey_gate_waived_at?: string // date-time\n assigned_to?: Array<string | {\n variable: string\n value?: string[]\n }>\n ecp_placeholder_assignees?: {\n placeholder_ecp_customers?: string[]\n placeholder_ecp_installers?: string[]\n }\n analytics: {\n started_at?: string // date-time\n in_progress_at?: string // date-time\n completed_at?: string // date-time\n status_updated_at?: string // date-time\n in_progress_by?: string\n completed_by?: string\n skipped_at?: string // date-time\n // ...\n}\n```\n\n### `AutomationFailurePolicy`\n\nWhat the flow does when this automation ends in a failed state. `stop` waits on the failed task until it is retried or skipped. `continue` proceeds to the next task. An absent value means `stop`.\n\n```ts\ntype AutomationFailurePolicy = "stop" | "continue"\n```\n\n### `LoopInfo`\n\nInformation about loop iterations, when task is part of a loop branch\n\n```ts\ntype LoopInfo = {\n max_iterations: number\n crt_iterations?: number\n}\n```\n\n### `LoopExecutionState`\n\n```ts\ntype LoopExecutionState = {\n entry_branch_ids: string[]\n exit_branch_id: string\n max_iterations: number\n crt_iteration?: number\n target_id?: string\n outer_loop_ids?: string[]\n depth?: number\n}\n```\n\n### `LoopMembership`\n\n```ts\ntype LoopMembership = {\n loop_id: string\n runs_in_loop: boolean\n}\n```\n\n### `LoopOutcome`\n\nWhat taking the branch does to its decision\'s loop at the current count. `closes_lap` starts another iteration, `enters_body` continues inside the loop, `exits_loop` leaves it, `budget_spent` would continue it but no iterations are left, so the exit branch is taken instead.\n\n```ts\ntype LoopOutcome = "closes_lap" | "enters_body" | "exits_loop" | "budget_spent"\n```\n\n### `LoopConfig`\n\nRead `loops` instead. Kept for executions started before `loops`.\n\n```ts\ntype LoopConfig = {\n loop_branch_id: string\n exit_branch_id: string\n max_iterations: number\n crt_iterations?: number\n}\n```\n\n### `TriggerMode`\n\n```ts\ntype TriggerMode = "manual" | "automatic"\n```\n\n### `ActionSchedule`\n\n```ts\ntype ActionSchedule = {\n mode: "immediate"\n} | {\n mode: "delayed"\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n schedule_id?: string\n scheduled_at?: string\n error_reason?: string\n} | {\n mode: "relative"\n direction: "before" | "after"\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n reference: {\n id: string\n origin: "flow_started" | "task_completed" | "trigger_entity_attribute" | "all_preceding_tasks_completed"\n schema?: string\n attribute?: string\n }\n schedule_id?: string\n scheduled_at?: string\n error_reason?: string\n}\n```\n\n### `ImmediateSchedule`\n\n```ts\ntype ImmediateSchedule = {\n mode: "immediate"\n}\n```\n\n### `DelayedSchedule`\n\n```ts\ntype DelayedSchedule = {\n mode: "delayed"\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n schedule_id?: string\n scheduled_at?: string\n error_reason?: string\n}\n```\n\n### `RelativeSchedule`\n\n```ts\ntype RelativeSchedule = {\n mode: "relative"\n direction: "before" | "after"\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n reference: {\n id: string\n origin: "flow_started" | "task_completed" | "trigger_entity_attribute" | "all_preceding_tasks_completed"\n schema?: string\n attribute?: string\n }\n schedule_id?: string\n scheduled_at?: string\n error_reason?: string\n}\n```\n\n### `DecisionTask`\n\n```ts\ntype DecisionTask = {\n id: string\n loop_membership?: Array<{\n loop_id: string\n runs_in_loop: boolean\n }>\n template_id: string\n name: string\n description?: {\n enabled?: boolean\n value?: string\n }\n status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n journey?: {\n id?: string\n journeyId?: string\n name?: string\n portal_button_label?: string\n complete_task_automatically?: boolean\n journey_submission_required?: boolean\n context_parameters?: Array<{\n key: { ... }\n value: { ... }\n }>\n ai_prefill?: {\n enabled?: { ... }\n source?: { ... }\n extraction_fields?: { ... }\n mappings?: { ... }\n min_confidence?: { ... }\n instructions?: { ... }\n }\n }\n journey_prefill?: {\n status: "PENDING" | "READY" | "FAILED" | "SKIPPED"\n agent_execution_id?: string\n dispatched_at?: string // date-time\n extracted_at?: string // date-time\n initial_state?: Record<string, unknown>\n field_confidence?: Record<string, number>\n dropped?: Array<{\n source?: { ... }\n block_id?: { ... }\n reason: { ... }\n }>\n }\n due_date?: string\n due_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "START_DATE"\n task_id?: string\n phase_id?: string\n }\n start_date?: string\n start_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "THIS_TASK_LAST_COMPLETED"\n task_id?: string\n }\n requirements?: Array<{\n task_id?: string\n phase_id?: string\n when: "TASK_FINISHED" | "PHASE_FINISHED"\n }>\n required?: boolean\n subtasks?: Array<{\n id: string\n name?: string\n party: "description" | "ecp" | "installer" | "partner"\n required?: boolean\n }>\n subtask_states?: Record<string, {\n completed: boolean\n completed_by?: string\n completed_at?: string // date-time\n }>\n journey_submission?: {\n submission_entity_id?: string\n submitted_at?: string // date-time\n }\n completion_gates_reset_at?: string // date-time\n journey_gate_waived_at?: string // date-time\n assigned_to?: Array<string | {\n variable: string\n value?: string[]\n }>\n ecp_placeholder_assignees?: {\n placeholder_ecp_customers?: string[]\n placeholder_ecp_installers?: string[]\n }\n analytics: {\n started_at?: string // date-time\n in_progress_at?: string // date-time\n completed_at?: string // date-time\n status_updated_at?: string // date-time\n in_progress_by?: string\n completed_by?: string\n skipped_at?: string // date-time\n // ...\n}\n```\n\n### `AiAgentTask`\n\n```ts\ntype AiAgentTask = {\n id: string\n loop_membership?: Array<{\n loop_id: string\n runs_in_loop: boolean\n }>\n template_id: string\n name: string\n description?: {\n enabled?: boolean\n value?: string\n }\n status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n journey?: {\n id?: string\n journeyId?: string\n name?: string\n portal_button_label?: string\n complete_task_automatically?: boolean\n journey_submission_required?: boolean\n context_parameters?: Array<{\n key: { ... }\n value: { ... }\n }>\n ai_prefill?: {\n enabled?: { ... }\n source?: { ... }\n extraction_fields?: { ... }\n mappings?: { ... }\n min_confidence?: { ... }\n instructions?: { ... }\n }\n }\n journey_prefill?: {\n status: "PENDING" | "READY" | "FAILED" | "SKIPPED"\n agent_execution_id?: string\n dispatched_at?: string // date-time\n extracted_at?: string // date-time\n initial_state?: Record<string, unknown>\n field_confidence?: Record<string, number>\n dropped?: Array<{\n source?: { ... }\n block_id?: { ... }\n reason: { ... }\n }>\n }\n due_date?: string\n due_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "START_DATE"\n task_id?: string\n phase_id?: string\n }\n start_date?: string\n start_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "THIS_TASK_LAST_COMPLETED"\n task_id?: string\n }\n requirements?: Array<{\n task_id?: string\n phase_id?: string\n when: "TASK_FINISHED" | "PHASE_FINISHED"\n }>\n required?: boolean\n subtasks?: Array<{\n id: string\n name?: string\n party: "description" | "ecp" | "installer" | "partner"\n required?: boolean\n }>\n subtask_states?: Record<string, {\n completed: boolean\n completed_by?: string\n completed_at?: string // date-time\n }>\n journey_submission?: {\n submission_entity_id?: string\n submitted_at?: string // date-time\n }\n completion_gates_reset_at?: string // date-time\n journey_gate_waived_at?: string // date-time\n assigned_to?: Array<string | {\n variable: string\n value?: string[]\n }>\n ecp_placeholder_assignees?: {\n placeholder_ecp_customers?: string[]\n placeholder_ecp_installers?: string[]\n }\n analytics: {\n started_at?: string // date-time\n in_progress_at?: string // date-time\n completed_at?: string // date-time\n status_updated_at?: string // date-time\n in_progress_by?: string\n completed_by?: string\n skipped_at?: string // date-time\n // ...\n}\n```\n\n### `AgentConfig`\n\nConfiguration for AI Agent to run\n\n```ts\ntype AgentConfig = {\n agent_id: string\n parameters?: object\n}\n```\n\n### `AgentExecutionInfo`\n\n```ts\ntype AgentExecutionInfo = {\n execution_id?: string\n execution_status?: "queued" | "pending" | "started" | "running" | "waiting_approval" | "approval_required" | "completed" | "failed" | "cancelled"\n queued_at?: string // date-time\n queued_attempts?: number\n error_reason?: string\n outcome?: string\n completion_hold?: "required_subtasks"\n}\n```\n\n### `TaskAudience`\n\nA task audience, named after the task field holding its description: co-workers (description), end customers (ecp), installers and partners.\n\n```ts\ntype TaskAudience = "description" | "ecp" | "installer" | "partner"\n```\n\n### `TaskBase`\n\n```ts\ntype TaskBase = {\n id: string\n loop_membership?: Array<{\n loop_id: string\n runs_in_loop: boolean\n }>\n template_id: string\n name: string\n description?: {\n enabled?: boolean\n value?: string\n }\n status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n journey?: {\n id?: string\n journeyId?: string\n name?: string\n portal_button_label?: string\n complete_task_automatically?: boolean\n journey_submission_required?: boolean\n context_parameters?: Array<{\n key: { ... }\n value: { ... }\n }>\n ai_prefill?: {\n enabled?: { ... }\n source?: { ... }\n extraction_fields?: { ... }\n mappings?: { ... }\n min_confidence?: { ... }\n instructions?: { ... }\n }\n }\n journey_prefill?: {\n status: "PENDING" | "READY" | "FAILED" | "SKIPPED"\n agent_execution_id?: string\n dispatched_at?: string // date-time\n extracted_at?: string // date-time\n initial_state?: Record<string, unknown>\n field_confidence?: Record<string, number>\n dropped?: Array<{\n source?: { ... }\n block_id?: { ... }\n reason: { ... }\n }>\n }\n due_date?: string\n due_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "START_DATE"\n task_id?: string\n phase_id?: string\n }\n start_date?: string\n start_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "THIS_TASK_LAST_COMPLETED"\n task_id?: string\n }\n requirements?: Array<{\n task_id?: string\n phase_id?: string\n when: "TASK_FINISHED" | "PHASE_FINISHED"\n }>\n required?: boolean\n subtasks?: Array<{\n id: string\n name?: string\n party: "description" | "ecp" | "installer" | "partner"\n required?: boolean\n }>\n subtask_states?: Record<string, {\n completed: boolean\n completed_by?: string\n completed_at?: string // date-time\n }>\n journey_submission?: {\n submission_entity_id?: string\n submitted_at?: string // date-time\n }\n completion_gates_reset_at?: string // date-time\n journey_gate_waived_at?: string // date-time\n assigned_to?: Array<string | {\n variable: string\n value?: string[]\n }>\n ecp_placeholder_assignees?: {\n placeholder_ecp_customers?: string[]\n placeholder_ecp_installers?: string[]\n }\n analytics: {\n started_at?: string // date-time\n in_progress_at?: string // date-time\n completed_at?: string // date-time\n status_updated_at?: string // date-time\n in_progress_by?: string\n completed_by?: string\n skipped_at?: string // date-time\n // ...\n}\n```\n\n### `Stage`\n\nA customer-facing progress segment layered on top of the flow graph, copied from the flow template when the execution starts. Unlike phases (internal task grouping), stages exist to communicate progress to outside users (e.g. end customers) with a title and description. Stages form a strict total or\n\n```ts\ntype Stage = {\n id: string\n name: string\n description?: string\n entry_node_id?: string\n cut_edge_ids?: string[]\n color?: string\n portal_names?: {\n ecp?: string\n installer?: string\n }\n portal_descriptions?: {\n ecp?: string\n installer?: string\n }\n}\n```\n\n### `Phase`\n\n```ts\ntype Phase = {\n id: string\n template_id: string\n name: string\n status?: "OPEN" | "IN_PROGRESS" | "COMPLETED"\n updated_at?: string\n due_date?: string\n due_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "START_DATE"\n task_id?: string\n phase_id?: string\n }\n assigned_to?: Array<string | {\n variable: string\n value?: string[]\n }>\n analytics?: {\n started_at?: string // date-time\n in_progress_at?: string // date-time\n completed_at?: string // date-time\n status_updated_at?: string // date-time\n in_progress_by?: string\n completed_by?: string\n skipped_at?: string // date-time\n skipped_by?: string\n on_hold_by?: string\n }\n taxonomies?: string[]\n loop_config?: {\n max_iterations: number\n crt_iterations?: number\n }\n loop_membership?: Array<{\n loop_id: string\n runs_in_loop: boolean\n }>\n}\n```\n\n### `Edge`\n\n```ts\ntype Edge = {\n id: string\n from_id: string\n to_id: string\n condition_id?: string\n none_met?: boolean\n loop_id?: string\n}\n```\n\n### `AutomationInfo`\n\n```ts\ntype AutomationInfo = {\n flow_id: string\n execution_id?: string\n execution_status?: string\n error_reason?: string\n input_context?: {\n source: "main_context" | "task" | "trigger"\n task_id?: string\n trigger_id?: string\n with_relations?: boolean\n also_pass?: Array<{\n source: { ... }\n } | {\n source: { ... }\n task_id: { ... }\n }>\n }\n output_context?: {\n set_as_primary?: boolean\n attach_to_contexts?: boolean\n }\n heal_attempts?: number\n run_for_user_id?: string\n last_heal_attempted_at?: string // date-time\n wait_for_journey_submission?: boolean\n journey_id?: string\n journey_execution?: {\n execution_id?: string\n execution_status?: string\n error_reason?: string\n submission_entity_id?: string\n submission_created_at?: string // date-time\n wait_overridden_at?: string // date-time\n wait_overridden_by?: string\n }\n eligible_closing_reason_ids?: string[]\n allow_execution_note?: boolean\n email_review?: {\n enabled?: boolean\n allow_document_selection?: boolean\n allow_subject_and_body_edit?: boolean\n }\n}\n```\n\n### `JourneyExecutionInfo`\n\nServer-managed. Tracks the journey automation execution a task in WAITING_FOR_JOURNEY_SUBMISSION is (or was) waiting on. Cleared whenever the task\'s automation state is reset (revert, loop-back, clear status).\n\n```ts\ntype JourneyExecutionInfo = {\n execution_id?: string\n execution_status?: string\n error_reason?: string\n submission_entity_id?: string\n submission_created_at?: string // date-time\n wait_overridden_at?: string // date-time\n wait_overridden_by?: string\n}\n```\n\n### `AutomationInputContext`\n\nOptional. Source of the entity fed into this automation task. If omitted, the run\'s current main context is used.\n\n\n```ts\ntype AutomationInputContext = {\n source: "main_context" | "task" | "trigger"\n task_id?: string\n trigger_id?: string\n with_relations?: boolean\n also_pass?: Array<{\n source: "main_context"\n } | {\n source: "task"\n task_id: string\n }>\n}\n```\n\n### `AutomationInputExtraContextRef`\n\nOne of the run\'s own entities. `main_context` = the run\'s current main context.\n\n\n```ts\ntype AutomationInputExtraContextRef = {\n source: "main_context"\n}\n```\n\n### `AutomationInputExtraTaskRef`\n\nEvery entity produced by an upstream task.\n\n```ts\ntype AutomationInputExtraTaskRef = {\n source: "task"\n task_id: string\n}\n```\n\n### `AutomationOutputContext`\n\nOptional. What happens to the entity produced by this automation task (the last successful entity-producing action of its automation).\n\n\n```ts\ntype AutomationOutputContext = {\n set_as_primary?: boolean\n attach_to_contexts?: boolean\n}\n```\n\n### `AnalyticsInfo`\n\n```ts\ntype AnalyticsInfo = {\n started_at?: string // date-time\n in_progress_at?: string // date-time\n completed_at?: string // date-time\n status_updated_at?: string // date-time\n in_progress_by?: string\n completed_by?: string\n skipped_at?: string // date-time\n skipped_by?: string\n on_hold_by?: string\n}\n```\n\n### `ConditionResult`\n\nHow one of a decision task\'s conditions stood when a loop pass closed.\n`is_met: false` means the branch was evaluated and rejected; an absent\nentry means it was never reached.\n\n\n```ts\ntype ConditionResult = {\n id: string\n is_met?: boolean\n evaluated_at?: string // date-time\n match_normalizations?: "unicode" | "invisible" | "whitespace" | "case"[]\n}\n```\n\n### `TaskIteration`\n\nA task\'s state as it stood at the close of one pass through a loop. The owning task and the loop key identify it, so neither id is repeated here.\n\n```ts\ntype TaskIteration = {\n iteration: number\n recorded_at: string // date-time\n status: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n analytics?: {\n started_at?: string // date-time\n in_progress_at?: string // date-time\n completed_at?: string // date-time\n status_updated_at?: string // date-time\n in_progress_by?: string\n completed_by?: string\n skipped_at?: string // date-time\n skipped_by?: string\n on_hold_by?: string\n }\n automation_execution_id?: string\n agent_execution_id?: string\n error_reason?: string\n execution_status?: string\n outcome?: string\n condition_results?: Array<{\n id: string\n is_met?: boolean\n evaluated_at?: string // date-time\n match_normalizations?: "unicode" | "invisible" | "whitespace" | "case"[]\n }>\n schedule_id?: string\n}\n```\n\n### `ConditionId`\n\nA locally unique identifier for the condition\n\n```ts\ntype ConditionId = string\n```\n\n### `Condition`\n\n```ts\ntype Condition = {\n id: string\n branch_name: string\n logical_operator: "AND" | "OR"\n statements: Array<{\n id: string\n source: {\n id?: { ... }\n origin?: { ... }\n origin_type?: { ... }\n schema?: { ... }\n attribute?: { ... }\n attribute_type?: { ... }\n attribute_repeatable?: { ... }\n attribute_operation?: { ... }\n attributes?: { ... }\n attributes_match?: { ... }\n attribute_sub_field?: { ... }\n date_offset?: { ... }\n }\n operator: "equals" | "not_equals" | "any_of" | "none_of" | "contains" | "not_contains" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "greater_than_or_equals" | "less_than_or_equals" | "is_empty" | "is_not_empty"\n values: string[]\n value_type?: "static" | "relative_date"\n }>\n evaluated_at?: string // date-time\n is_met?: boolean\n loop_outcome?: "closes_lap" | "enters_body" | "exits_loop" | "budget_spent"\n match_normalizations?: "unicode" | "invisible" | "whitespace" | "case"[]\n}\n```\n\n### `Statement`\n\n```ts\ntype Statement = {\n id: string\n source: {\n id?: string\n origin?: "trigger" | "action" | "flow_runtime"\n origin_type?: "entity" | "workflow" | "journey_block" | "trigger_source" | "main_context" | "flow_trait"\n schema?: string\n attribute?: string\n attribute_type?: "string" | "text" | "number" | "boolean" | "date" | "datetime" | "tags" | "country" | "email" | "phone" | "product" | "price" | "status" | "relation" | "multiselect" | "select" | "radio" | "relation_user" | "purpose" | "label" | "message_email_address"\n attribute_repeatable?: boolean\n attribute_operation?: "all" | "updated" | "added" | "deleted"\n attributes?: string[]\n attributes_match?: "any" | "all"\n attribute_sub_field?: string\n date_offset?: {\n amount?: { ... }\n unit?: { ... }\n }\n }\n operator: "equals" | "not_equals" | "any_of" | "none_of" | "contains" | "not_contains" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "greater_than_or_equals" | "less_than_or_equals" | "is_empty" | "is_not_empty"\n values: string[]\n value_type?: "static" | "relative_date"\n}\n```\n\n### `EvaluationSource`\n\n```ts\ntype EvaluationSource = {\n id?: string\n origin?: "trigger" | "action" | "flow_runtime"\n origin_type?: "entity" | "workflow" | "journey_block" | "trigger_source" | "main_context" | "flow_trait"\n schema?: string\n attribute?: string\n attribute_type?: "string" | "text" | "number" | "boolean" | "date" | "datetime" | "tags" | "country" | "email" | "phone" | "product" | "price" | "status" | "relation" | "multiselect" | "select" | "radio" | "relation_user" | "purpose" | "label" | "message_email_address"\n attribute_repeatable?: boolean\n attribute_operation?: "all" | "updated" | "added" | "deleted"\n attributes?: string[]\n attributes_match?: "any" | "all"\n attribute_sub_field?: string\n date_offset?: {\n amount?: number\n unit?: "days" | "months" | "years"\n }\n}\n```\n\n### `Operator`\n\n```ts\ntype Operator = "equals" | "not_equals" | "any_of" | "none_of" | "contains" | "not_contains" | "starts_with" | "ends_with" | "greater_than" | "less_than" | "greater_than_or_equals" | "less_than_or_equals" | "is_empty" | "is_not_empty"\n```\n\n### `DueDateConfig`\n\nSet due date for the task based on a dynamic condition. `START_DATE` counts from the task\'s own start date (AL-3678). A template may set it only on a task that has a start date; sent on a task, phase or flow without one, it is stored but has no effect, and the stored due date stays.\n\n```ts\ntype DueDateConfig = {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "START_DATE"\n task_id?: string\n phase_id?: string\n}\n```\n\n### `StartDateConfig`\n\nRelative start date of a task (AL-3678): `duration` `unit` after the most recent occurrence of the reference event. `THIS_TASK_LAST_COMPLETED` is the task\'s own previous completion (a loop\'s earlier pass); there is no wait while the reference event has not happened. Durations are positive whole numb\n\n```ts\ntype StartDateConfig = {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "THIS_TASK_LAST_COMPLETED"\n task_id?: string\n}\n```\n\n### `TimeUnit`\n\n```ts\ntype TimeUnit = "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n```\n\n### `EnableRequirement`\n\ndescribe the requirement for a task to be enabled\n\n```ts\ntype EnableRequirement = {\n task_id?: string\n phase_id?: string\n when: "TASK_FINISHED" | "PHASE_FINISHED"\n}\n```\n\n### `Subtask`\n\nOne checklist item of a task, derived from the checklist markup in the party descriptions. Identity is the stable data-subtask-id the editor mints into the markup.\n\n```ts\ntype Subtask = {\n id: string\n name?: string\n party: "description" | "ecp" | "installer" | "partner"\n required?: boolean\n}\n```\n\n### `SubtaskState`\n\nCompletion state of one subtask. `completed_by` and `completed_at` are server-managed \u2014 stamped when a PATCH flips `completed` to true, cleared when it flips back to false.\n\n```ts\ntype SubtaskState = {\n completed: boolean\n completed_by?: string\n completed_at?: string // date-time\n}\n```\n\n### `FlowTemplateId`\n\n```ts\ntype FlowTemplateId = string\n```\n\n### `FlowExecutionId`\n\n```ts\ntype FlowExecutionId = string\n```\n\n### `UserId`\n\nThe user id\n\n```ts\ntype UserId = string\n```\n\n### `EcpPlaceholderAssignees`\n\nServer-managed, execution-only: for each customer / installer portal placeholder the task is configured with (`placeholder_ecp_customers`, `placeholder_ecp_installers`), the portal user ids it put on the task and still manages. An empty list means the placeholder matches nobody yet. Written at flow \n\n```ts\ntype EcpPlaceholderAssignees = {\n placeholder_ecp_customers?: string[]\n placeholder_ecp_installers?: string[]\n}\n```\n\n### `VariableAssignment`\n\nRepresents a variable assignment with its expression and optional resolved value. Used for dynamic user assignments that get resolved during workflow execution.\n\n```ts\ntype VariableAssignment = {\n variable: string\n value?: string[]\n}\n```\n\n### `Assignees`\n\nThe user ids or variable assignments\n\n```ts\ntype Assignees = Array<string | {\n variable: string\n value?: string[]\n}>\n```\n\n### `RunTaskAutomationReq`\n\nThe bounded choice a person makes when running a semi-automated task. Optional in full: a task that configures no choice runs from its automation\'s stored configuration.\n\nNothing here is trusted as sent. Each input is checked against the stored task \u2014 never against the request \u2014 and is rejected unle\n\n```ts\ntype RunTaskAutomationReq = {\n action_inputs?: {\n cancel_flow_execution?: {\n selected_closing_reason_ids: { ... }\n extra_description?: { ... }\n }\n send_email?: {\n subject?: { ... }\n body?: { ... }\n attachment_entity_ids?: { ... }\n }\n }\n}\n```\n\n### `TaskAutomationActionInputs`\n\nRun-time inputs keyed by the automation action they belong to. An action whose key is absent runs entirely from its configuration.\n\n```ts\ntype TaskAutomationActionInputs = {\n cancel_flow_execution?: {\n selected_closing_reason_ids: string[]\n extra_description?: string\n }\n send_email?: {\n subject?: string\n body?: string\n attachment_entity_ids?: string[]\n }\n}\n```\n\n### `CancelFlowExecutionInputs`\n\nThe reason the person chose for cancelling the flow. Ids only \u2014 the titles stored on the closed execution are resolved server-side from the execution\'s `closing_reason.configured_reasons`, so a caller cannot record a reason under a title of its own choosing.\n\n```ts\ntype CancelFlowExecutionInputs = {\n selected_closing_reason_ids: string[]\n extra_description?: string\n}\n```\n\n### `TaskEmailPreview`\n\nThe rendered email a send-email task is about to send. `subject` is what the person edits, and `body` too while `body_edit_locked` is false; the rest is shown for context and is not editable.\n\n```ts\ntype TaskEmailPreview = {\n subject?: string\n body?: string\n to?: string[]\n has_unresolved_send_time_variables?: boolean\n body_edit_locked?: boolean\n attachable_documents?: Array<{\n id: string\n filename: string\n }>\n inline_images?: Array<{\n cid: string\n url: string\n }>\n}\n```\n\n### `EmailReviewConfig`\n\nCopied from the template task at flow start. Says whether the person running this step reviews the email first, and what they may change. Anything they send that this does not permit is refused.\n\n```ts\ntype EmailReviewConfig = {\n enabled?: boolean\n allow_document_selection?: boolean\n allow_subject_and_body_edit?: boolean\n}\n```\n\n### `SendEmailInputs`\n\nThe adjustments a person made to a reviewed email. Each field is accepted only when the task\'s `email_review` permits it; sent otherwise it is a 400, so a caller cannot rewrite an email the configurator locked.\n\nThese are the RENDERED values, not template edits \u2014 the template is untouched and other \n\n```ts\ntype SendEmailInputs = {\n subject?: string\n body?: string\n attachment_entity_ids?: string[]\n}\n```\n\n### `PatchTaskReq`\n\nRequest payload for updating a task within a flow execution.\nAll fields are optional; only provided fields will be updated.\n\n\n```ts\ntype PatchTaskReq = {\n name?: string\n status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n due_date?: string\n due_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "START_DATE"\n task_id?: string\n phase_id?: string\n }\n assigned_to?: Array<string | {\n variable: string\n value?: string[]\n }>\n enabled?: boolean\n automation_config?: {\n flow_id: string\n execution_id?: string\n execution_status?: string\n error_reason?: string\n input_context?: {\n source: { ... }\n task_id?: { ... }\n trigger_id?: { ... }\n with_relations?: { ... }\n also_pass?: { ... }\n }\n output_context?: {\n set_as_primary?: { ... }\n attach_to_contexts?: { ... }\n }\n heal_attempts?: number\n run_for_user_id?: string\n last_heal_attempted_at?: string // date-time\n wait_for_journey_submission?: boolean\n journey_id?: string\n journey_execution?: {\n execution_id?: { ... }\n execution_status?: { ... }\n error_reason?: { ... }\n submission_entity_id?: { ... }\n submission_created_at?: { ... }\n wait_overridden_at?: { ... }\n wait_overridden_by?: { ... }\n }\n eligible_closing_reason_ids?: string[]\n allow_execution_note?: boolean\n email_review?: {\n enabled?: { ... }\n allow_document_selection?: { ... }\n allow_subject_and_body_edit?: { ... }\n }\n }\n description?: {\n enabled?: boolean\n value?: string\n }\n ecp?: {\n enabled?: boolean\n label?: string\n description?: string\n journey?: {\n id?: { ... }\n journeyId?: { ... }\n name?: { ... }\n portal_button_label?: { ... }\n complete_task_automatically?: { ... }\n journey_submission_required?: { ... }\n context_parameters?: { ... }\n ai_prefill?: { ... }\n }\n }\n installer?: {\n enabled?: boolean\n label?: string\n description?: string\n journey?: {\n id?: { ... }\n journeyId?: { ... }\n name?: { ... }\n portal_button_label?: { ... }\n complete_task_automatically?: { ... }\n journey_submission_required?: { ... }\n context_parameters?: { ... }\n ai_prefill?: { ... }\n }\n }\n partner?: {\n enabled?: boolean\n label?: string\n description?: string\n }\n subtask_states?: Record<string, {\n completed: boolean\n completed_by?: string\n completed_at?: string // date-time\n }>\n next_condition_id?: string\n next_condition_ids?: string[]\n // ...\n}\n```\n\n### `PatchPhaseReq`\n\n```ts\ntype PatchPhaseReq = {\n name?: string\n due_date?: string\n due_date_config?: {\n duration: number\n unit: "minutes" | "hours" | "days" | "weeks" | "months" | "years"\n type: "WORKFLOW_STARTED" | "TASK_FINISHED" | "PHASE_FINISHED" | "A_PRECEDING_TASK_COMPLETED" | "ALL_PRECEDING_TASKS_COMPLETED" | "START_DATE"\n task_id?: string\n phase_id?: string\n }\n assigned_to?: Array<string | {\n variable: string\n value?: string[]\n }>\n}\n```\n\n### `AddTaskReq`\n\n```ts\ntype AddTaskReq = {\n previous_task_id: string // uuid\n next_task_id: string // uuid\n task: {\n id?: string // uuid\n name: string\n status?: "UNASSIGNED" | "ASSIGNED" | "COMPLETED" | "SKIPPED" | "IN_PROGRESS" | "SCHEDULED" | "PENDING" | "CONDITION_PENDING" | "WAITING_FOR_CONFIRMATION" | "WAITING_FOR_JOURNEY_SUBMISSION" | "ON_HOLD" | "FAILED"\n due_date?: string\n due_date_config?: {\n duration: { ... }\n unit: { ... }\n type: { ... }\n task_id?: { ... }\n phase_id?: { ... }\n }\n assigned_to?: Array<string | {\n variable: { ... }\n value?: { ... }\n }>\n enabled?: boolean\n automation_config?: {\n flow_id: { ... }\n execution_id?: { ... }\n execution_status?: { ... }\n error_reason?: { ... }\n input_context?: { ... }\n output_context?: { ... }\n heal_attempts?: { ... }\n run_for_user_id?: { ... }\n last_heal_attempted_at?: { ... }\n wait_for_journey_submission?: { ... }\n journey_id?: { ... }\n journey_execution?: { ... }\n eligible_closing_reason_ids?: { ... }\n allow_execution_note?: { ... }\n email_review?: { ... }\n }\n phase_id?: string\n task_type?: "MANUAL" | "AUTOMATION" | "DECISION" | "AI_AGENT"\n }\n}\n```\n';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.default = workflow_default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSWEH4LP3cjs = require('./chunk-SWEH4LP3.cjs');
|
|
4
4
|
require('./chunk-NJK5F5TF.cjs');
|
|
5
|
-
exports. default =
|
|
5
|
+
exports. default = _chunkSWEH4LP3cjs.require_workflow_runtime.call(void 0, );
|