diff --git a/src/automations/index.js b/src/automations/index.js index 6aecccfb..0b2291d6 100644 --- a/src/automations/index.js +++ b/src/automations/index.js @@ -23,6 +23,16 @@ export default class Automations { }) } + async loadFlowExecutionContext(executionId) { + if (!executionId || typeof executionId !== 'string') { + throw new Error('The "executionId" argument must be provided and must be a string.') + } + + return this.app.request.get({ + url : this.app.urls.automationFlowExecutionContext(executionId), + }) + } + async activateFlowById(flowId, initialData) { if (!flowId || typeof flowId !== 'string') { throw new Error('The "flowId" argument must be provided and must be a string.') diff --git a/src/urls.js b/src/urls.js index 506bcf87..eabb6fd6 100644 --- a/src/urls.js +++ b/src/urls.js @@ -23,6 +23,10 @@ export default class Urls { return `${this.automation()}/flow` } + automationFlowExecutionContext(executionId) { + return `${this.automation()}/flow/execution-context/${executionId}` + } + automationFlowTrigger() { return `${this.automationFlow()}/trigger` }