Jeton pour la page suivante des résultats













Planifications des workflows
API Workflows - planifications.












Exemples
Exemples réels de code
Obtenir les planifications
GET /v1/workflows/schedules#
Obtenir les planifications
200
Réponse réussie
next_page_token#
Playground
Testez les endpoints en direct
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();
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()
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'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"
}
]
}{
"schedules": [
{
"input": "Example input.",
"paused": false,
"schedule_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"workflow_name": "support-workflow"
}
]
}Planifier un workflow
POST /v1/workflows/schedules#
Planifier un workflow
deployment_name#
Nom du déploiement vers lequel router cette planification
Spécification des moments où les actions planifiées peuvent se produire.
Les moments sont l'union de :py:attr:calendars, :py:attr:intervals et
:py:attr:cron_expressions, à l'exclusion de tout ce qui se trouve dans :py:attr:skip.
Utilisé pour les entrées où schedule_id est optionnel (peut être fourni ou généré automatiquement).
schedule_id#
Permet de spécifier un identifiant de planification personnalisé. Si non fourni, un identifiant aléatoire sera généré.
workflow_version_id#
Déprécié : utilisez workflow_registration_id
201
Réponse réussie
Playground
Testez les endpoints en direct
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();
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)
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."
}
}'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"
}{
"schedule_id": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}Obtenir une planification
GET /v1/workflows/schedules/{schedule_id}#
Obtenir une planification
200
Réponse réussie
cron_expressions#
Spécification basée sur une expression cron des horaires.
deployment_name#
Nom du déploiement ciblé par cette planification.
end_at#
Heure après laquelle aucune autre action ne sera exécutée.
future_executions#
Exécutions planifiées à venir (10 prochaines exécutions, de la plus ancienne à la plus récente).
jitter#
Gigue à appliquer à chaque action.
L'heure planifiée d'une action sera incrémentée d'une valeur aléatoire comprise entre 0 et cette valeur si elle est présente (mais pas au-delà de la prochaine planification).
note#
Note lisible par l'humain associée à l'état actuel de pause ou de reprise.
Indique si la planification est actuellement en pause.
policy#
recent_executions#
Exécutions planifiées les plus récentes (10 plus récentes, de la plus ancienne à la plus récente).
remaining_executions#
Exécutions restantes du workflow avant que cette planification ne cesse de se déclencher automatiquement. null signifie illimité ; 0 signifie que la limite a été atteinte et que la planification est épuisée.
start_at#
Heure après laquelle la première action peut être exécutée.
time_zone_name#
Nom de fuseau horaire IANA, par exemple US/Central.
Playground
Testez les endpoints en direct
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();
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)
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'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"
}{
"input": "Example input.",
"paused": false,
"schedule_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"workflow_name": "support-workflow"
}Annuler la planification d'un workflow
DELETE /v1/workflows/schedules/{schedule_id}#
Annuler la planification d’un workflow
Playground
Testez les endpoints en direct
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
await mistral.workflows.schedules.unscheduleWorkflow({
scheduleId: "<id>",
});
}
run();
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 ...
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'curl https://api.mistral.ai/v1/workflows/schedules/{schedule_id} \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json'Mettre à jour une planification
PATCH /v1/workflows/schedules/{schedule_id}#
Mettre à jour une planification
Définition de planification pour les mises à jour partielles.
Tous les champs sont optionnels (hérités de _ScheduleRequestBase). Seuls les champs explicitement définis sont appliqués lors d'une mise à jour ; les champs non définis conservent les valeurs existantes du planning.
200
Réponse réussie
Playground
Testez les endpoints en direct
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();
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)
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": {}
}'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"
}{
"schedule_id": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}Mettre en pause une planification
POST /v1/workflows/schedules/{schedule_id}/pause#
Mettre en pause une planification
WorkflowSchedulePauseRequest#
Playground
Testez les endpoints en direct
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
await mistral.workflows.schedules.pauseSchedule({
scheduleId: "<id>",
});
}
run();
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 ...
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'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'Reprendre une planification
POST /v1/workflows/schedules/{schedule_id}/resume#
Rependre une planification
WorkflowSchedulePauseRequest#
Playground
Testez les endpoints en direct
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
await mistral.workflows.schedules.resumeSchedule({
scheduleId: "<id>",
});
}
run();
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 ...
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'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'Déclencher une planification
POST /v1/workflows/schedules/{schedule_id}/trigger#
Déclencher une planification
WorkflowScheduleTriggerRequest#
Playground
Testez les endpoints en direct
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
await mistral.workflows.schedules.triggerSchedule({
scheduleId: "<id>",
});
}
run();
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 ...
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'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'