MCPcopy Create free account
hub / github.com/ShipSecAI/studio / loadDefinition

Function loadDefinition

worker/scripts/workflow-execute-inline.ts:15–25  ·  view source on GitHub ↗
(pool: Pool, workflowId: string)

Source from the content-addressed store, hash-verified

13import * as schema from '../src/adapters/schema';
14
15async function loadDefinition(pool: Pool, workflowId: string): Promise<WorkflowDefinition> {
16 const { rows } = await pool.query<{ compiled_definition: WorkflowDefinition | null }>(
17 'SELECT compiled_definition FROM workflows WHERE id=$1',
18 [workflowId],
19 );
20 const definition = rows[0]?.compiled_definition;
21 if (!definition) {
22 throw new Error(`Workflow ${workflowId} has no compiled definition`);
23 }
24 return definition;
25}
26
27async function main() {
28 const workflowId = process.argv[2] ?? 'f38c93d7-e0fb-47b1-bbfc-fdb6cd19a325';

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected