MCPcopy Index your code
hub / github.com/simstudioai/sim / buildExecutionEventPayload

Function buildExecutionEventPayload

apps/sim/lib/workspace-events/payload.ts:69–84  ·  view source on GitHub ↗
(params: {
  event: Exclude<SimPlainEventType, 'workflow_deployed' | 'workflow_undeployed'> | SimRuleEventType
  workflowName: string
  context: ExecutionEventContext
})

Source from the content-addressed store, hash-verified

67 * the condition that fired, so it nests under `triggeringRun`.
68 */
69export 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. */
87export function buildDeployEventPayload(params: {

Callers 2

payload.test.tsFile · 0.90

Calls 2

summarizeRunFunction · 0.85
basePayloadFunction · 0.70

Tested by

no test coverage detected