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

Function createTestWorkflow

apps/sim/executor/variables/resolvers/block.test.ts:138–162  ·  view source on GitHub ↗
(
  blocks: Array<{
    id: string
    name?: string
    type?: string
    outputs?: Record<string, any>
  }> = [],
  subflows: { loops?: Record<string, any>; parallels?: Record<string, any> } = {}
)

Source from the content-addressed store, hash-verified

136}))
137
138function createTestWorkflow(
139 blocks: Array<{
140 id: string
141 name?: string
142 type?: string
143 outputs?: Record<string, any>
144 }> = [],
145 subflows: { loops?: Record<string, any>; parallels?: Record<string, any> } = {}
146) {
147 return {
148 version: '1.0',
149 blocks: blocks.map((b) => ({
150 id: b.id,
151 position: { x: 0, y: 0 },
152 config: { tool: b.type ?? 'function', params: {} },
153 inputs: {},
154 outputs: b.outputs ?? {},
155 metadata: { id: b.type ?? 'function', name: b.name ?? b.id },
156 enabled: true,
157 })),
158 connections: [],
159 loops: subflows.loops ?? {},
160 parallels: subflows.parallels ?? {},
161 }
162}
163
164/**
165 * Creates a test ResolutionContext with block outputs.

Callers 1

block.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected