( pendingRuns: WorkflowGroupCellPayload[] )
| 236 | * id. The cell-job import pulls in the executor + blocks stack, so skip it on |
| 237 | * trigger.dev to avoid a multi-second dispatcher cold-start. */ |
| 238 | export async function buildEnqueueItems( |
| 239 | pendingRuns: WorkflowGroupCellPayload[] |
| 240 | ): Promise<Array<{ payload: WorkflowGroupCellPayload; options: EnqueueOptions }>> { |
| 241 | const runner = isTriggerDevEnabled |
| 242 | ? undefined |
| 243 | : ((await import('@/background/workflow-column-execution')) |
| 244 | .executeWorkflowGroupCellJob as EnqueueOptions['runner']) |
| 245 | return pendingRuns.map((runOpts) => ({ |
| 246 | payload: runOpts, |
| 247 | options: { |
| 248 | metadata: { |
| 249 | workflowId: runOpts.workflowId, |
| 250 | workspaceId: runOpts.workspaceId, |
| 251 | correlation: { |
| 252 | executionId: runOpts.executionId, |
| 253 | requestId: `wfgrp-${runOpts.executionId}`, |
| 254 | source: 'workflow' as const, |
| 255 | workflowId: runOpts.workflowId, |
| 256 | triggerType: 'table', |
| 257 | }, |
| 258 | }, |
| 259 | concurrencyKey: runOpts.tableId, |
| 260 | concurrencyLimit: TABLE_CONCURRENCY_LIMIT, |
| 261 | tags: cellTagsFor(runOpts), |
| 262 | ...(runner ? { runner } : {}), |
| 263 | cancelKey: cellCancelKey(runOpts.tableId, runOpts.rowId, runOpts.groupId), |
| 264 | }, |
| 265 | })) |
| 266 | } |
| 267 | |
| 268 | /** Stable key for `cancelInlineRun` lookups. Stamped on every enqueue item by |
| 269 | * `buildEnqueueItems`; the cancel path computes the same key per cell. */ |
no test coverage detected