(params: {
event: Exclude<SimPlainEventType, 'workflow_deployed' | 'workflow_undeployed'> | SimRuleEventType
workflowName: string
context: ExecutionEventContext
})
| 67 | * the condition that fired, so it nests under `triggeringRun`. |
| 68 | */ |
| 69 | export function buildExecutionEventPayload(params: { |
| 70 | event: Exclude<SimPlainEventType, 'workflow_deployed' | 'workflow_undeployed'> | SimRuleEventType |
| 71 | workflowName: string |
| 72 | context: ExecutionEventContext |
| 73 | }): SimEventPayload { |
| 74 | const { event, workflowName, context } = params |
| 75 | |
| 76 | const base = basePayload({ event, workflowId: context.workflowId, workflowName }) |
| 77 | const run = summarizeRun(context) |
| 78 | |
| 79 | if (event === 'execution_success' || event === 'execution_error') { |
| 80 | return { ...base, ...run } |
| 81 | } |
| 82 | |
| 83 | return { ...base, triggeringRun: run } |
| 84 | } |
| 85 | |
| 86 | /** Payload for workflow_deployed events. */ |
| 87 | export function buildDeployEventPayload(params: { |
no test coverage detected