Tree BG 1
Tree
Tree
TreeLeaves
TreeLeaves
Cat IdleGrassGrassRockRock

Workflows Schedules Endpoints

Workflows API - schedules.

Get Schedules

GET /v1/workflows/schedules

Get Schedules

200

Successful Response

next_page_token
string|null

Token for the next page of results

A list of workflow schedules

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.workflows.schedules.getSchedules();

  for await (const page of result) {
    console.log(page);
  }
}

run();
from mistralai.client import Mistral
import os


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

    res = mistral.workflows.schedules.get_schedules()

    while res is not None:
        # Handle items

        res = res.next()

curl https://api.mistral.ai/v1/workflows/schedules \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "schedules": [
    {
      "input": "Example input.",
      "paused": false,
      "schedule_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
      "workflow_name": "support-workflow"
    }
  ]
}

Schedule Workflow

POST /v1/workflows/schedules

Schedule Workflow

201

Successful Response

schedule_id
*string

The ID of the schedule

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.workflows.schedules.scheduleWorkflow({
    schedule: {
      input: "<value>",
    },
  });

  console.log(result);
}

run();
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)

curl https://api.mistral.ai/v1/workflows/schedules \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{
  "schedule": {
    "input": "Example input."
  }
}'

201

{
  "schedule_id": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}

Get Schedule

GET /v1/workflows/schedules/{schedule_id}

Get Schedule

200

Successful Response

Calendar-based specification of times.

cron_expressions
array<string>

Cron-based specification of times.

deployment_name
string|null

Name of the deployment this schedule targets.

end_at
date-time|null

Time after which no more actions will be run.

future_executions
array<ScheduleFutureExecution>

Upcoming scheduled executions (10 next executions, earliest first).

input
*any

Input to provide to the workflow when starting it.

Interval-based specification of times.

jitter
string|null

Jitter to apply each action.

An action's scheduled time will be incremented by a random value between 0 and this value if present (but not past the next schedule).

note
string|null

Human-readable note associated with the current pause or resume state.

paused
*boolean

Whether the schedule is currently paused.

recent_executions
array<ScheduleRecentExecution>

Most recent scheduled executions (10 most recent, newest last).

remaining_executions
integer|null

Remaining workflow executions before this schedule stops triggering automatically. null means unlimited; 0 means the limit has been reached and the schedule is exhausted.

schedule_id
*string

Unique identifier for the schedule.

Calendar-based specification of times.

start_at
date-time|null

Time after which the first action may be run.

time_zone_name
string|null

IANA time zone name, for example US/Central.

workflow_name
*string

Name of the workflow this schedule triggers.

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.workflows.schedules.getSchedule({
    scheduleId: "<id>",
  });

  console.log(result);
}

run();
from mistralai.client import Mistral
import os


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

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

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/workflows/schedules/{schedule_id} \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'

200

{
  "input": "Example input.",
  "paused": false,
  "schedule_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
  "workflow_name": "support-workflow"
}

Unschedule Workflow

DELETE /v1/workflows/schedules/{schedule_id}

Unschedule Workflow

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  await mistral.workflows.schedules.unscheduleWorkflow({
    scheduleId: "<id>",
  });


}

run();
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 ...

curl https://api.mistral.ai/v1/workflows/schedules/{schedule_id} \
 -X DELETE \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json'

Update Schedule

PATCH /v1/workflows/schedules/{schedule_id}

Update Schedule

200

Successful Response

schedule_id
*string

The ID of the schedule

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  const result = await mistral.workflows.schedules.updateSchedule({
    scheduleId: "<id>",
    workflowScheduleUpdateRequest: {
      schedule: {},
    },
  });

  console.log(result);
}

run();
from mistralai.client import Mistral
import os


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

    res = mistral.workflows.schedules.update_schedule(schedule_id="<id>", schedule={})

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/workflows/schedules/{schedule_id} \
 -X PATCH \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{
  "schedule": {}
}'

200

{
  "schedule_id": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}

Pause Schedule

POST /v1/workflows/schedules/{schedule_id}/pause

Pause Schedule

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  await mistral.workflows.schedules.pauseSchedule({
    scheduleId: "<id>",
  });


}

run();
from mistralai.client import Mistral
import os


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

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

    # Use the SDK ...

curl https://api.mistral.ai/v1/workflows/schedules/{schedule_id}/pause \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d 'null'

Resume Schedule

POST /v1/workflows/schedules/{schedule_id}/resume

Resume Schedule

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  await mistral.workflows.schedules.resumeSchedule({
    scheduleId: "<id>",
  });


}

run();
from mistralai.client import Mistral
import os


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

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

    # Use the SDK ...

curl https://api.mistral.ai/v1/workflows/schedules/{schedule_id}/resume \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d 'null'

Trigger Schedule

POST /v1/workflows/schedules/{schedule_id}/trigger

Trigger Schedule

Playground

Test the endpoints live

import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: "MISTRAL_API_KEY",
});

async function run() {
  await mistral.workflows.schedules.triggerSchedule({
    scheduleId: "<id>",
  });


}

run();
from mistralai.client import Mistral
import os


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

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

    # Use the SDK ...

curl https://api.mistral.ai/v1/workflows/schedules/{schedule_id}/trigger \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d 'null'