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

Function buildIntegrationTriggerOutput

apps/sim/executor/utils/start-block.ts:534–560  ·  view source on GitHub ↗
(
  workflowInput: unknown,
  structuredInput: Record<string, unknown>,
  hasStructured: boolean
)

Source from the content-addressed store, hash-verified

532}
533
534function buildIntegrationTriggerOutput(
535 workflowInput: unknown,
536 structuredInput: Record<string, unknown>,
537 hasStructured: boolean
538): NormalizedBlockOutput {
539 const output: NormalizedBlockOutput = {}
540 const structuredKeys = hasStructured ? new Set(Object.keys(structuredInput)) : null
541
542 if (hasStructured) {
543 for (const [key, value] of Object.entries(structuredInput)) {
544 output[key] = value
545 }
546 }
547
548 if (isRecordLike(workflowInput)) {
549 for (const [key, value] of Object.entries(workflowInput)) {
550 if (structuredKeys?.has(key)) continue
551 if (value !== undefined && value !== null) {
552 output[key] = value
553 } else if (!Object.hasOwn(output, key)) {
554 output[key] = value
555 }
556 }
557 }
558
559 return mergeFilesIntoOutput(output, workflowInput)
560}
561
562function extractSubBlocks(block: SerializedBlock): Record<string, unknown> | undefined {
563 const metadata = block.metadata

Callers 1

buildStartBlockOutputFunction · 0.85

Calls 2

isRecordLikeFunction · 0.90
mergeFilesIntoOutputFunction · 0.85

Tested by

no test coverage detected