Overview

The Workflows API allows you to manage AI workflows within the Wacht platform. You can list, retrieve, create, update, and delete AI workflows.

fetchWorkflows(options?: ListWorkflowsOptions)

Lists all AI workflows.

Parameters

  • options (optional): An object containing pagination and filtering options.
    • page (number): The page number to retrieve.
    • per_page (number): The number of items per page.
    • search (string): Search term for workflows.
    • is_active (boolean): Filter by active status.

Returns

Promise<WorkflowListResponse>: A promise that resolves to a list of AI workflows and pagination information.

createWorkflow(request: CreateAiWorkflowRequest)

Creates a new AI workflow.

Parameters

  • request (CreateAiWorkflowRequest): The request body containing the details of the new AI workflow.

Returns

Promise<AiWorkflow>: A promise that resolves to the newly created AI workflow object.

fetchWorkflow(workflowId: string)

Retrieves a specific AI workflow by its ID.

Parameters

  • workflowId (string): The unique identifier of the AI workflow.

Returns

Promise<AiWorkflow>: A promise that resolves to the AI workflow object.

updateWorkflow(workflowId: string, request: UpdateAiWorkflowRequest)

Updates an existing AI workflow.

Parameters

  • workflowId (string): The unique identifier of the AI workflow to update.
  • request (UpdateAiWorkflowRequest): The request body containing the updated details of the AI workflow.

Returns

Promise<AiWorkflow>: A promise that resolves to the updated AI workflow object.

deleteWorkflow(workflowId: string)

Deletes an AI workflow by its ID.

Parameters

  • workflowId (string): The unique identifier of the AI workflow to delete.

Returns

Promise<void>: A promise that resolves when the workflow is successfully deleted.