MCPcopy
hub / github.com/simstudioai/sim / useWorkflowState

Function useWorkflowState

apps/sim/hooks/queries/workflows.ts:76–83  ·  view source on GitHub ↗
(workflowId: string | undefined)

Source from the content-addressed store, hash-verified

74 * store's hydration and with `useWorkflowStates`.
75 */
76export function useWorkflowState(workflowId: string | undefined) {
77 return useQuery({
78 queryKey: workflowKeys.state(workflowId),
79 queryFn: workflowId ? ({ signal }) => fetchWorkflowEnvelope(workflowId, signal) : skipToken,
80 select: mapWorkflowState,
81 staleTime: 30 * 1000,
82 })
83}
84
85/**
86 * Batched workflow-state fetch for callers that need state for several

Callers 5

WorkflowSidebarBodyFunction · 0.90
PreviewEditorContentFunction · 0.90
EditorFunction · 0.90
WorkflowInputMapperInputFunction · 0.90
InputMappingFunction · 0.90

Calls 2

fetchWorkflowEnvelopeFunction · 0.90
stateMethod · 0.80

Tested by

no test coverage detected