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

Function useScheduleQuery

apps/sim/hooks/queries/schedules.ts:120–133  ·  view source on GitHub ↗
(
  workflowId: string | undefined,
  blockId: string | undefined,
  options?: { enabled?: boolean }
)

Source from the content-addressed store, hash-verified

118 * Hook to fetch schedule data for a workflow block
119 */
120export function useScheduleQuery(
121 workflowId: string | undefined,
122 blockId: string | undefined,
123 options?: { enabled?: boolean }
124) {
125 return useQuery({
126 queryKey: scheduleKeys.schedule(workflowId ?? '', blockId ?? ''),
127 queryFn: ({ signal }) => fetchSchedule(workflowId!, blockId!, signal),
128 enabled: !!workflowId && !!blockId && (options?.enabled ?? true),
129 staleTime: 30 * 1000, // 30 seconds
130 retry: false,
131 placeholderData: keepPreviousData,
132 })
133}
134
135/**
136 * Hook to get processed schedule info with human-readable timing

Callers 2

ScheduleInfoFunction · 0.90
useScheduleInfoFunction · 0.85

Calls 1

fetchScheduleFunction · 0.85

Tested by

no test coverage detected