IafWorkflowSvc
Use the IafWorkflowSvc API to manage workflows and their components, schedules, tasks, and permissions on the platform.
createPermissions#
Creates workflow permissions
| Parameter | Required | Type | Description |
|---|---|---|---|
| permissions | Yes | Array<IafPermissionDescriptor> | Permissions array |
| ctx | Yes | Object | Context object |
Promise<Object> - Permissions response
await IafWorkflowSvc.createPermissions([{ _resourceDesc: {} }], ctx);createWorkflowDef#
Creates a new Workflow definition
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowDef | Yes | WorkflowDef | Workflow definition payload |
| ctx | Yes | Object | Context object |
Promise<WorkflowDef> - Created Workflow definition
const newDef = await IafWorkflowSvc.createWorkflowDef(workflowDef, ctx);createWorkflowSchedule#
Creates a workflow schedule
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowDefId | Yes | String | Workflow definition ID |
| workflowSchedule | Yes | Object | Workflow schedule payload |
| ctx | Yes | Object | Context object |
Promise<Object> - Created workflow schedule
const schedule = await IafWorkflowSvc.createWorkflowSchedule(workflowDefId, payload, ctx);deletePermission#
Deletes a workflow permission by ID
| Parameter | Required | Type | Description |
|---|---|---|---|
| id | Yes | String | Permission ID |
| ctx | Yes | Object | Context object |
Promise<Object> - Delete response
await IafWorkflowSvc.deletePermission('permId', ctx);deleteWorkflowDef#
Deletes a workflow definition
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowDefId | Yes | String | Workflow definition ID |
| ctx | Yes | Object | Context object |
Promise<Object> - Delete response.
await IafWorkflowSvc.deleteWorkflowDef(workflowDefId, ctx);deleteWorkflowScheduleJob#
Deletes a workflow schedule job
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowDefId | Yes | String | Workflow definition ID |
| jobId | Yes | String | Job ID |
| ctx | Yes | Object | Context object |
Promise<Object> - Delete response
await IafWorkflowSvc.deleteWorkflowScheduleJob('workflowDefId', 'jobId', ctx);deleteWorkflowSchedules#
Deletes all workflow schedules for a workflow definition
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowDefId | Yes | String | Workflow definition ID |
| ctx | Yes | Object | Context object |
Promise<Object> - Delete response
await IafWorkflowSvc.deleteWorkflowSchedules('workflowDefId', ctx);deleteWorkflowScheduleTrigger#
Deletes a trigger for a workflow schedule
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowDefId | Yes | String | Workflow definition ID |
| triggerId | Yes | String | Trigger ID |
| ctx | Yes | Object | Context object |
Promise<Object> - Delete response
await IafWorkflowSvc.deleteWorkflowScheduleTrigger('workflowDefId', 'triggerId', ctx);getLoopOverTasks#
Fetches loop-over tasks for a workflow.
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowId | Yes | String | Workflow ID. |
| taskId | Yes | String | Task ID. |
| ctx | Yes | Object | Context object. |
| criteria | Yes | Object | Filter criteria. |
Promise<Array<TaskDef>> - Loop-over tasks.
const loops = await IafWorkflowSvc.getLoopOverTasks(workflowId, taskId, ctx, { count: 10 });getPermissions#
Gets workflow permissions based on your criteria
| Parameter | Required | Type | Description |
|---|---|---|---|
| criteria | Yes | Object | Filter criteria. |
| ctx | Yes | Object | Context object. |
Promise<Object> - Permissions.
const perms = await IafWorkflowSvc.getPermissions({ type: 'read' }, ctx);getTaskById#
Fetches a task by Workflow and Task IDs
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowId | Yes | String | Workflow ID |
| taskId | Yes | String | Task ID |
| ctx | Yes | Object | Context object |
Promise<TaskDef> - The fetched Task
const task = await IafWorkflowSvc.getTaskById(workflowId, taskId, ctx);getWorkflowComponents#
Fetches Workflow components with formal parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| ctx | Yes | Object | Context object. |
Promise<Object> - Workflow components response
await IafWorkflowSvc.getWorkflowComponents(workflowDefId, ctx);getWorkflowDef#
Fetches a workflow definition by ID
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowDefId | Yes | String | Workflow definition ID |
| ctx | Yes | Object | Context object |
Promise<WorkflowDef> - Workflow definition
const def = await IafWorkflowSvc.getWorkflowDef(workflowDefId, ctx);getWorkflowDefs#
Fetches workflow definitions based the criteria you pass
| Parameter | Required | Type | Description |
|---|---|---|---|
| criteria | Yes | Object | Filter criteria for workflows |
| ctx | Yes | Object | Context object |
| options | No | Object | Additional control options |
Promise<Array<WorkflowDef>> - Workflow definitions.
const defs = await IafWorkflowSvc.getWorkflowDefs({ count: 10 }, ctx);getWorkflowScheduleJob#
Fetches a workflow schedule job by ID
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowDefId | Yes | String | Workflow definition ID |
| jobId | Yes | String | Job ID |
| ctx | Yes | Object | Context object |
Promise<Object> - Workflow schedule job
const job = await IafWorkflowSvc.getWorkflowScheduleJob('workflowDefId', 'jobId', ctx);getWorkflowScheduleJobTriggers#
Fetches all triggers for a workflow schedule job
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowDefId | Yes | String | Workflow definition ID |
| jobId | Yes | String | Job ID |
| ctx | Yes | Object | Context object |
Promise<Object> - Triggers for the job
const triggers = await IafWorkflowSvc.getWorkflowScheduleJobTriggers('workflowDefId', 'jobId', ctx);getWorkflowSchedules#
Fetches all workflow schedules for a workflow definition
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowDefId | Yes | String | Workflow definition ID |
| ctx | Yes | Object | Context object |
Promise<Object> - Workflow schedules
const schedules = await IafWorkflowSvc.getWorkflowSchedules('workflowDefId', ctx);getWorkflowStatus#
Gets workflow status by run ID
| Parameter | Required | Type | Description |
|---|---|---|---|
| runId | Yes | String | Workflow run ID |
| ctx | Yes | Object | Context object |
Promise<Object> - Workflow status
const status = await IafWorkflowSvc.getWorkflowStatus(runId, ctx);getWorkflowTriggers#
Fetches all triggers for a workflow definition
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowDefId | Yes | String | Workflow definition ID |
| ctx | Yes | Object | Context object |
Promise<Object> - Triggers for the workflow definition
const triggers = await IafWorkflowSvc.getWorkflowTriggers('workflowDefId', ctx);runWorkflow#
Runs a Workflow
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowDefId | Yes | String | Workflow definition ID |
| params | Yes | Object | Input parameters for the workflow |
| ctx | Yes | Object | Context object |
Promise<Object> - Run response
const params = { _workflowDefId: workflowDefId }; const result = await IafWorkflowSvc.runWorkflow(workflowDefId, params, ctx);updatePermissions#
Updates a Workflow's permissions
| Parameter | Required | Type | Description |
|---|---|---|---|
| permissions | Yes | Array<IafPermissionDescriptor> | Permissions array |
| ctx | Yes | Object | Context object |
Promise<Object> - Update response
await IafWorkflowSvc.updatePermissions([{ _resourceDesc: {} }], ctx);updateUserInput#
Updates the user input for a workflow
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowId | Yes | String | Workflow ID |
| userInputId | Yes | String | User input ID |
| payload | Yes | Object | User input payload |
| ctx | Yes | Object | Context object |
Promise<Object> - Updated response
await IafWorkflowSvc.updateUserInput(workflowId, userInputId, payload, ctx);updateWorkflowDef#
Updates an existing Workflow definition
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowDefId | Yes | String | Workflow definition ID |
| workflowDef | Yes | WorkflowDef | Updated workflow definition payload |
| ctx | Yes | Object | Context object. |
Promise<WorkflowDef> - Updated workflow definition
const updated = await IafWorkflowSvc.updateWorkflowDef(workflowDefId, workflowDef, ctx);updateWorkflowStatus#
Updates a workflow by run ID
| Parameter | Required | Type | Description |
|---|---|---|---|
| workflowRunId | Yes | String | Workflow run ID |
| params | Yes | WorkflowDef | Input parameters for the workflow |
| ctx | Yes | Object | Context object |
Promise<WorkflowDef> - Update response.
await IafWorkflowSvc.updateWorkflow('runId', ctx);