* Find the appropriate start block for a given execution context
(
blocks: Record<string, T>,
executionType: 'chat' | 'manual' | 'api' | 'external',
isChildWorkflow = false
)
| 409 | * Find the appropriate start block for a given execution context |
| 410 | */ |
| 411 | static findStartBlock<T extends { type: string; subBlocks?: any }>( |
| 412 | blocks: Record<string, T>, |
| 413 | executionType: 'chat' | 'manual' | 'api' | 'external', |
| 414 | isChildWorkflow = false |
| 415 | ): (StartBlockCandidate<T> & { block: T }) | null { |
| 416 | const candidates = resolveStartCandidates(blocks, { |
| 417 | execution: executionType, |
| 418 | isChildWorkflow, |
| 419 | }) |
| 420 | |
| 421 | if (candidates.length === 0) { |
| 422 | return null |
| 423 | } |
| 424 | |
| 425 | const [primary] = candidates |
| 426 | return primary |
| 427 | } |
| 428 | |
| 429 | /** |
| 430 | * Check if multiple triggers of a restricted type exist |
no test coverage detected