import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient"; import * as core from "../../../../core"; import * as Extend from "../../../index"; export declare namespace WorkflowRunsClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } export declare class WorkflowRunsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: WorkflowRunsClient.Options); /** * List runs of a Workflow. Workflows are sequences of steps that process files and data in a specific order to achieve a desired outcome. A WorkflowRun represents a single execution of a workflow against a file. * * @param {Extend.WorkflowRunsListRequest} request * @param {WorkflowRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.workflowRuns.list({ * nextPageToken: "xK9mLPqRtN3vS8wF5hB2cQ==:zWvUxYjM4nKpL7aDgE9HbTcR2mAyX3/Q+CNkfBSw1dZ=" * }) */ list(request?: Extend.WorkflowRunsListRequest, requestOptions?: WorkflowRunsClient.RequestOptions): core.HttpResponsePromise; private __list; /** * Run a workflow with a file. A workflow is a sequence of steps that process files and data in a specific order to achieve a desired outcome. * * The request returns immediately with a `PROCESSING` status. Use webhooks or poll the Get Workflow Run endpoint for results. * * @param {Extend.WorkflowRunsCreateRequest} request * @param {WorkflowRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.workflowRuns.create({ * workflow: { * id: "wf_1234567890" * }, * file: { * url: "https://example.com/invoice.pdf" * } * }) */ create(request: Extend.WorkflowRunsCreateRequest, requestOptions?: WorkflowRunsClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Once a workflow has been run, you can check the status and output of a specific WorkflowRun. * * @param {string} id - The ID of the workflow run. * * Example: `"workflow_run_xKm9pNv3qWsY_jL2tR5Dh"` * @param {Extend.WorkflowRunsRetrieveRequest} request * @param {WorkflowRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.workflowRuns.retrieve("workflow_run_id_here") */ retrieve(id: string, request?: Extend.WorkflowRunsRetrieveRequest, requestOptions?: WorkflowRunsClient.RequestOptions): core.HttpResponsePromise; private __retrieve; /** * You can update the name and metadata of an in progress WorkflowRun at any time using this endpoint. * * @param {string} id - The ID of the workflow run. * * Example: `"workflow_run_xKm9pNv3qWsY_jL2tR5Dh"` * @param {Extend.WorkflowRunsUpdateRequest} request * @param {WorkflowRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.workflowRuns.update("workflow_run_id_here", { * name: "Invoice #12345", * metadata: { * "customerId": "cust_abc123", * "source": "email-inbox" * } * }) */ update(id: string, request?: Extend.WorkflowRunsUpdateRequest, requestOptions?: WorkflowRunsClient.RequestOptions): core.HttpResponsePromise; private __update; /** * Delete a workflow run and all associated data from Extend. This operation is permanent and cannot be undone. * * This endpoint can be used if you'd like to manage data retention on your own rather than automated data retention policies. Or make one-off deletions for your downstream customers. * * @param {string} id - The ID of the workflow run. * * Example: `"workflow_run_xKm9pNv3qWsY_jL2tR5Dh"` * @param {Extend.WorkflowRunsDeleteRequest} request * @param {WorkflowRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.workflowRuns.delete("workflow_run_id_here") */ delete(id: string, request?: Extend.WorkflowRunsDeleteRequest, requestOptions?: WorkflowRunsClient.RequestOptions): core.HttpResponsePromise; private __delete; /** * Cancel a running workflow run by its ID. This endpoint allows you to stop a workflow run that is currently in progress. * * Note: Only workflow runs with a status of `PROCESSING` or `PENDING` can be cancelled. Workflow runs that are completed, failed, in review, rejected, or already cancelled cannot be cancelled. * * @param {string} id - The ID of the workflow run. * * Example: `"workflow_run_xKm9pNv3qWsY_jL2tR5Dh"` * @param {Extend.WorkflowRunsCancelRequest} request * @param {WorkflowRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.workflowRuns.cancel("workflow_run_id_here") */ cancel(id: string, request?: Extend.WorkflowRunsCancelRequest, requestOptions?: WorkflowRunsClient.RequestOptions): core.HttpResponsePromise; private __cancel; /** * This endpoint allows you to efficiently initiate large batches of workflow runs in a single request (up to 1,000 in a single request, but you can queue up multiple batches in rapid succession). It accepts an array of inputs, each containing a file and metadata pair. The primary use case for this endpoint is for doing large bulk runs of >1000 files at a time that can process over the course of a few hours without needing to manage rate limits that would likely occur using the primary run endpoint. * * Unlike the single [Run Workflow](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/workflow/create-workflow-run) endpoint which returns the details of the created workflow runs immediately, this batch endpoint returns a `batchId`. * * Our recommended usage pattern is to integrate with [Webhooks](https://docs.extend.ai/2026-02-09/product/webhooks/configuration) for consuming results, using the `metadata` and `batchId` to match up results to the original inputs in your downstream systems. However, you can integrate in a polling mechanism by using a combination of the [List Workflow Runs](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/workflow/list-workflow-runs) endpoint to fetch all runs via a batch, and then [Get Workflow Run](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/workflow/get-workflow-run) to fetch the full outputs each run. * * **Priority:** All workflow runs created through this batch endpoint are automatically assigned a priority of 90. * * **Processing and Monitoring:** * Upon successful submission, the endpoint returns a `batchId`. The individual workflow runs are then queued for processing. * * - **Monitoring:** Track the progress and consume results of individual runs using [Webhooks](https://docs.extend.ai/2026-02-09/product/webhooks/configuration). Subscribe to events like `workflow_run.completed`, `workflow_run.failed`, etc. The webhook payload for these events will include the corresponding `batchId` and the `metadata` you provided for each input. * - **Fetching Results:** You can also use the [List Workflow Runs](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/workflow/list-workflow-runs) endpoint and filter using the `batchId` query param. * * @param {Extend.WorkflowRunsCreateBatchRequest} request * @param {WorkflowRunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Extend.BadRequestError} * @throws {@link Extend.UnauthorizedError} * @throws {@link Extend.PaymentRequiredError} * @throws {@link Extend.ForbiddenError} * @throws {@link Extend.NotFoundError} * @throws {@link Extend.UnprocessableEntityError} * @throws {@link Extend.TooManyRequestsError} * @throws {@link Extend.InternalServerError} * * @example * await client.workflowRuns.createBatch({ * workflow: { * id: "wf_1234567890" * }, * inputs: [{ * file: { * url: "https://example.com/invoice1.pdf" * }, * metadata: { * "customerId": "cust_abc123" * } * }, { * file: { * url: "https://example.com/invoice2.pdf" * }, * metadata: { * "customerId": "cust_def456" * } * }] * }) */ createBatch(request: Extend.WorkflowRunsCreateBatchRequest, requestOptions?: WorkflowRunsClient.RequestOptions): core.HttpResponsePromise; private __createBatch; }