Skip to content

Latest commit

 

History

History
133 lines (87 loc) · 15.8 KB

File metadata and controls

133 lines (87 loc) · 15.8 KB

Workflows.Schedules

Overview

Available Operations

get_schedules

Get Schedules

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.schedules.get_schedules()

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.WorkflowScheduleListResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

schedule_workflow

Schedule Workflow

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.workflows.schedules.schedule_workflow(schedule={
        "input": "<value>",
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
schedule models.ScheduleDefinition ✔️ Specification of the times scheduled actions may occur.

The times are the union of :py:attr:calendars, :py:attr:intervals, and
:py:attr:cron_expressions excluding anything in :py:attr:skip.

Used for input where schedule_id is optional (can be provided or auto-generated).
workflow_registration_id OptionalNullable[str] The ID of the workflow registration to schedule
workflow_version_id OptionalNullable[str] Deprecated: use workflow_registration_id
workflow_identifier OptionalNullable[str] The name or ID of the workflow to schedule
workflow_task_queue OptionalNullable[str] : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use deployment_name instead.
schedule_id OptionalNullable[str] Allows you to specify a custom schedule ID. If not provided, a random ID will be generated.
deployment_name OptionalNullable[str] Name of the deployment to route this schedule to
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.WorkflowScheduleResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

unschedule_workflow

Unschedule Workflow

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    mistral.workflows.schedules.unschedule_workflow(schedule_id="<id>")

    # Use the SDK ...

Parameters

Parameter Type Required Description
schedule_id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*