워크플로우 스케줄 엔드포인트
워크플로우 스케줄 엔드포인트 (Workflows Schedules Endpoints)
Workflows API의 스케줄(schedules) 관련 엔드포인트입니다. 워크플로우를 특정 시간에 자동 실행되도록 스케줄링하고, 조회·수정·일시중지·재개·트리거할 수 있어요.
출처: 문서
본문
Workflows API - schedules. 정기적으로 워크플로우를 돌리고 싶을 때 사용하는 엔드포인트 모음이에요. 실행할 시간을 정의하고, 필요하면 일시중지했다가 다시 재개하는 방식으로 관리할 수 있어요.
GET /v1/workflows/schedules — Get Schedules
스케줄 목록을 조회합니다.
응답 필드:
next_page_token#string|null — 다음 페이지 토큰schedules#*array<ScheduleDefinitionOutput> — 워크플로우 스케줄 목록
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: proces...EY"] ?? "",
});
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 ***'
응답 (200):
{
"schedules": [
{
"input": "Example input.",
"paused": false,
"schedule_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"workflow_name": "support-workflow"
}
]
}
POST /v1/workflows/schedules — Schedule Workflow
새 워크플로우 스케줄을 생성합니다.
본문 파라미터:
deployment_name#string|null — 이 스케줄을 라우팅할 배포 이름schedule#*ScheduleDefinition — 예약된 동작이 발생할 수 있는 시간의 사양. 시간은calendars,intervals,cron_expressions의 합집합에서skip에 포함된 것을 제외한 값이에요.schedule_id가 선택적(제공 또는 자동 생성)인 입력에 사용해요.schedule_id#string|null — 사용자 지정 스케줄 ID. 제공하지 않으면 무작위 ID가 생성돼요.workflow_identifier#string|null — 스케줄링할 워크플로우의 이름 또는 IDworkflow_registration_id#string|null — 스케줄링할 워크플로우 등록 IDworkflow_version_id#string|null — Deprecated:workflow_registration_id를 사용하세요.
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: proces...EY"] ?? "",
});
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 ***' \
-H 'Content-Type: application/json' \
-d '{
"schedule": {
"input": "Example input."
}
}'
응답 (201):
{
"schedule_id": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}
GET /v1/workflows/schedules/{schedule_id} — Get Schedule
개별 스케줄 상세 정보를 조회합니다.
파라미터:
schedule_id#*string
응답 필드:
calendars#array<ScheduleCalendar> — 달력 기반 시간 사양cron_expressions#array<string> — cron 기반 시간 사양deployment_name#string|null — 이 스케줄이 대상으로 하는 배포 이름end_at#date-time|null — 이 시간 이후 더 이상 동작을 실행하지 않음future_executions#array<ScheduleFutureExecution> — 예정된 실행 (가장 이른 순으로 다음 10개)input#*any — 워크플로우 시작 시 제공할 입력intervals#array<ScheduleInterval> — 간격 기반 시간 사양jitter#string|null — 각 동작에 적용할 지터. 있으면 동작 예약 시간이 0~이 값 사이의 무작위 값만큼 증가해요 (다음 스케줄을 넘지 않는 한).note#string|null — 현재 일시중지/재개 상태와 연관된 사람이 읽을 수 있는 메모paused#*boolean — 스케줄이 현재 일시중지되었는지policy#SchedulePolicyrecent_executions#array<ScheduleRecentExecution> — 가장 최근 실행 (가장 최근 순으로 10개, newest last)remaining_executions#integer|null — 이 스케줄이 자동 트리거를 멈추기 전 남은 워크플로우 실행 수. null은 무제한, 0은 한도에 도달해 스케줄이 소진된 상태.schedule_id#*string — 스케줄 고유 식별자skip#array<ScheduleCalendar> — 달력 기반 시간 사양 (제외 대상)start_at#date-time|null — 첫 동작이 실행될 수 있는 시간time_zone_name#string|null — IANA 타임존 이름, 예:US/Centralworkflow_name#*string — 이 스케줄이 트리거하는 워크플로우 이름
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: proces...EY"] ?? "",
});
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 ***'
응답 (200):
{
"input": "Example input.",
"paused": false,
"schedule_id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"workflow_name": "support-workflow"
}
DELETE /v1/workflows/schedules/{schedule_id} — Unschedule Workflow
스케줄을 삭제합니다.
파라미터: schedule_id#*string
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: proces...EY"] ?? "",
});
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 ***' \
-H 'Content-Type: application/json'
PATCH /v1/workflows/schedules/{schedule_id} — Update Schedule
스케줄을 부분 업데이트합니다.
파라미터:
schedule_id#*string
본문:
schedule#*PartialScheduleDefinition — 부분 업데이트용 스케줄 정의. 모든 필드는 선택 사항이며, 명시적으로 설정한 필드만 업데이트에 적용되고 설정하지 않은 필드는 기존 값을 유지해요.
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: proces...EY"] ?? "",
});
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 ***' \
-H 'Content-Type: application/json' \
-d '{
"schedule": {}
}'
응답 (200):
{
"schedule_id": "019b2bd7-96e7-7219-8c0b-45a73da50088"
}
POST /v1/workflows/schedules/{schedule_id}/pause — Pause Schedule
스케줄을 일시중지합니다.
파라미터: schedule_id#*string — 본문: WorkflowSchedulePauseRequest|null
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: proces...EY"] ?? "",
});
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 ***' \
-H 'Content-Type: application/json' \
-d 'null'
POST /v1/workflows/schedules/{schedule_id}/resume — Resume Schedule
일시중지된 스케줄을 재개합니다.
파라미터: schedule_id#*string — 본문: WorkflowSchedulePauseRequest|null
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: proces...EY"] ?? "",
});
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 ***' \
-H 'Content-Type: application/json' \
-d 'null'
POST /v1/workflows/schedules/{schedule_id}/trigger — Trigger Schedule
스케줄을 즉시 트리거합니다.
파라미터: schedule_id#*string — 본문: WorkflowScheduleTriggerRequest|null
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: proces...EY"] ?? "",
});
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 ***' \
-H 'Content-Type: application/json' \
-d 'null'
더 알아보기 (Learn more)
- Workflows Schedules Endpoints — 공식 문서
- Workflows Runs Endpoints — 실행 조회·히스토리
- Workflows Metrics Endpoints — 워크플로우 메트릭