Routines
Create or update a routine
Creates a new routine or replaces an existing routine with the supplied definition.
标头参数
Foundry-Features
enum
A feature flag opt-in required when using preview operations or modifying persisted preview resources.
路径参数
routine_name
string
必需
The unique name of the routine.
查询参数
api-version
string
必需
The API version to use for this operation.
请求正文
description
string
A human-readable description of the routine.
enabled
boolean
Whether the routine is enabled.
triggers
object
The triggers configured for the routine. In v1, exactly one trigger entry is supported.
[key: string]
schedule | timer | github_issue | custom
Base model for a routine trigger.
schedule
ScheduleRoutineTrigger
A recurring cron-based routine trigger.
type
enum
必需
The trigger type.
cron_expression
string
必需
A 5-field cron expression. The service enforces a minimum interval of five minutes by default.
time_zone
string
必需
An IANA or Windows time zone identifier for the schedule.
timer
TimerRoutineTrigger
A one-shot timer routine trigger.
type
enum
必需
The trigger type.
github_issue
GitHubIssueRoutineTrigger
A GitHub issue routine trigger.
type
enum
必需
The trigger type.
connection_id
string
必需
The workspace connection identifier that resolves the GitHub configuration for the trigger.
owner
string
必需
The GitHub owner or organization that scopes which issues can fire the trigger.
repository
string
必需
The GitHub repository filter that scopes which issues can fire the trigger.
issue_event
string | enum
必需
Known GitHub issue events that can fire a routine.
enum
custom
CustomRoutineTrigger
A custom event routine trigger.
type
enum
必需
The trigger type.
provider
string
必需
The external provider that emits the custom event.
event_name
string
The provider-specific event name that fires the routine.
parameters
object
必需
Provider-specific trigger parameters.
action
invoke_agent_responses_api | invoke_agent_invocations_api
Base model for a routine action.
invoke_agent_responses_api
InvokeAgentResponsesApiRoutineAction
Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id must be provided.
type
enum
必需
The action type.
agent_name
string
The project-scoped agent name for routine dispatch.
agent_endpoint_id
string
Legacy endpoint-scoped agent identifier for routine dispatch.
input
InvokeAgentResponsesApiRoutineAction
Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied.
conversation
string
An optional existing conversation identifier to continue during the downstream dispatch.
invoke_agent_invocations_api
InvokeAgentInvocationsApiRoutineAction
Dispatches a routine through the raw invocations API. Exactly one of agent_name or agent_endpoint_id must be provided.
type
enum
必需
The action type.
agent_name
string
The project-scoped agent name for routine dispatch.
agent_endpoint_id
string
Legacy endpoint-scoped agent identifier for routine dispatch.
input
InvokeAgentInvocationsApiRoutineAction
Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied.
session_id
string
An optional existing hosted-agent session identifier to continue during the downstream dispatch.
authorization
RoutineAuthorization
Optional authorization configuration for a routine dispatch.
identity
string | enum
The supported identities for routine dispatch authorization.
enum
响应
The request has succeeded.
正文
name
string
The routine name.
description
string
A human-readable description of the routine.
enabled
boolean
必需
Whether the routine is enabled.
triggers
object
The triggers configured for the routine.
[key: string]
schedule | timer | github_issue | custom
Base model for a routine trigger.
schedule
ScheduleRoutineTrigger
A recurring cron-based routine trigger.
type
enum
必需
The trigger type.
cron_expression
string
必需
A 5-field cron expression. The service enforces a minimum interval of five minutes by default.
time_zone
string
必需
An IANA or Windows time zone identifier for the schedule.
timer
TimerRoutineTrigger
A one-shot timer routine trigger.
type
enum
必需
The trigger type.
github_issue
GitHubIssueRoutineTrigger
A GitHub issue routine trigger.
type
enum
必需
The trigger type.
connection_id
string
必需
The workspace connection identifier that resolves the GitHub configuration for the trigger.
owner
string
必需
The GitHub owner or organization that scopes which issues can fire the trigger.
repository
string
必需
The GitHub repository filter that scopes which issues can fire the trigger.
issue_event
string | enum
必需
Known GitHub issue events that can fire a routine.
enum
custom
CustomRoutineTrigger
A custom event routine trigger.
type
enum
必需
The trigger type.
provider
string
必需
The external provider that emits the custom event.
event_name
string
The provider-specific event name that fires the routine.
parameters
object
必需
Provider-specific trigger parameters.
action
invoke_agent_responses_api | invoke_agent_invocations_api
Base model for a routine action.
invoke_agent_responses_api
InvokeAgentResponsesApiRoutineAction
Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id must be provided.
type
enum
必需
The action type.
agent_name
string
The project-scoped agent name for routine dispatch.
agent_endpoint_id
string
Legacy endpoint-scoped agent identifier for routine dispatch.
input
InvokeAgentResponsesApiRoutineAction
Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied.
conversation
string
An optional existing conversation identifier to continue during the downstream dispatch.
invoke_agent_invocations_api
InvokeAgentInvocationsApiRoutineAction
Dispatches a routine through the raw invocations API. Exactly one of agent_name or agent_endpoint_id must be provided.
type
enum
必需
The action type.
agent_name
string
The project-scoped agent name for routine dispatch.
agent_endpoint_id
string
Legacy endpoint-scoped agent identifier for routine dispatch.
input
InvokeAgentInvocationsApiRoutineAction
Static JSON value sent as the complete downstream input when the routine fires. The value is passed through as-is; no templating is applied.
session_id
string
An optional existing hosted-agent session identifier to continue during the downstream dispatch.
请求
PUT /routines/{routine_name} HTTP/1.1
响应
Status: 200
Content-Type: application/json
Status: 4XX
Content-Type: application/json
Status: 5XX
Content-Type: application/json