( input: ScheduleTriggerWorkflowInput, )
| 1123 | } |
| 1124 | |
| 1125 | export async function scheduleTriggerWorkflow( |
| 1126 | input: ScheduleTriggerWorkflowInput, |
| 1127 | ): Promise<RunWorkflowActivityOutput> { |
| 1128 | const triggerMetadata = |
| 1129 | input.trigger ?? |
| 1130 | ({ |
| 1131 | type: 'schedule', |
| 1132 | sourceId: input.scheduleId, |
| 1133 | label: input.scheduleName ?? 'Scheduled run', |
| 1134 | } satisfies ExecutionTriggerMetadata); |
| 1135 | |
| 1136 | const runId = `shipsec-run-${uuid4()}`; |
| 1137 | |
| 1138 | const prepared = await prepareRunPayloadActivity({ |
| 1139 | workflowId: input.workflowId, |
| 1140 | versionId: input.workflowVersionId ?? undefined, |
| 1141 | version: input.workflowVersion ?? undefined, |
| 1142 | inputs: input.runtimeInputs ?? {}, |
| 1143 | nodeOverrides: input.nodeOverrides ?? {}, |
| 1144 | trigger: triggerMetadata, |
| 1145 | organizationId: input.organizationId ?? null, |
| 1146 | runId, |
| 1147 | }); |
| 1148 | |
| 1149 | const child = await startChild(shipsecWorkflowRun, { |
| 1150 | args: [ |
| 1151 | { |
| 1152 | runId: prepared.runId, |
| 1153 | workflowId: prepared.workflowId, |
| 1154 | definition: prepared.definition as RunWorkflowActivityInput['definition'], |
| 1155 | inputs: prepared.inputs ?? {}, |
| 1156 | workflowVersionId: prepared.workflowVersionId, |
| 1157 | workflowVersion: prepared.workflowVersion, |
| 1158 | organizationId: prepared.organizationId, |
| 1159 | }, |
| 1160 | ], |
| 1161 | workflowId: prepared.runId, |
| 1162 | }); |
| 1163 | |
| 1164 | return child.result(); |
| 1165 | } |
| 1166 | |
| 1167 | // Export MCP discovery workflow |
| 1168 | export { mcpDiscoveryWorkflow, mcpGroupDiscoveryWorkflow } from './mcp-discovery-workflow.js'; |
nothing calls this directly
no test coverage detected