Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

486 B
Raw Blame
import { WorkerMachineWithStatus } from '@activepieces/shared';
import { useQuery } from '@tanstack/react-query';

import { workersApi } from '../api/workers-api';

export const workersKeys = {
  all: ['worker-machines'] as const,
};

export const workersQueries = {
  useWorkerMachines: () =>
    useQuery<WorkerMachineWithStatus[]>({
      queryKey: workersKeys.all,
      staleTime: 0,
      gcTime: 0,
      refetchInterval: 5000,
      queryFn: () => workersApi.list(),
    }),
};