Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/schedule-manual-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@truefoundry/trueforge": patch
---

Add POST /api/v1/schedules/{schedule_id}/runs to trigger an immediate manual schedule run (run-now)
114 changes: 114 additions & 0 deletions .github/fern/openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,23 @@
],
"type": "object"
},
"CreateManualScheduleRunRequest": {
Comment thread
sr07asthana marked this conversation as resolved.
Resolved
"additionalProperties": false,
"description": "Empty request body. The schedule task is taken from the schedule manifest.",
"properties": {},
"type": "object"
},
"CreateManualScheduleRunResponse": {
"properties": {
"data": {
"$ref": "#/components/schemas/ScheduleRun"
}
},
"required": [
"data"
],
"type": "object"
},
"CreateModelProviderRequest": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -6178,6 +6195,103 @@
"schedules"
],
"x-fern-sdk-method-name": "list_runs"
},
"post": {
"description": "Start a schedule run immediately (run-now) using the schedule task. Does not replace or advance the cron pending run.",
"parameters": [
{
"description": "Immutable schedule identifier.",
"in": "path",
"name": "schedule_id",
"required": true,
"schema": {
"description": "Immutable schedule identifier.",
"maxLength": 64,
"minLength": 1,
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateManualScheduleRunRequest"
}
}
},
"required": true
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateManualScheduleRunResponse"
}
}
},
"description": "Manual run created."
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RequestErrorResponse"
}
}
},
"description": "Invalid request or turn input."
},
"403": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RequestErrorResponse"
}
}
},
"description": "The caller is not the schedule creator."
},
"404": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RequestErrorResponse"
}
}
},
"description": "Schedule or agent not found."
},
"409": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RequestErrorResponse"
}
}
},
"description": "Run name conflict (retry)."
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RequestErrorResponse"
}
}
},
"description": "The run cannot be started (e.g. agent resources unavailable)."
}
},
"summary": "Trigger a manual schedule run",
"tags": [
"Schedules"
],
"x-fern-sdk-group-name": [
"schedules"
],
"x-fern-sdk-method-name": "create_manual_run"
}
},
"/api/v1/sessions": {
Expand Down
114 changes: 114 additions & 0 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,23 @@
],
"type": "object"
},
"CreateManualScheduleRunRequest": {
"additionalProperties": false,
"description": "Empty request body. The schedule task is taken from the schedule manifest.",
"properties": {},
"type": "object"
},
"CreateManualScheduleRunResponse": {
"properties": {
"data": {
"$ref": "#/components/schemas/ScheduleRun"
}
},
"required": [
"data"
],
"type": "object"
},
"CreateModelProviderRequest": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -6178,6 +6195,103 @@
"schedules"
],
"x-fern-sdk-method-name": "list_runs"
},
"post": {
"description": "Start a schedule run immediately (run-now) using the schedule task. Does not replace or advance the cron pending run.",
"parameters": [
{
"description": "Immutable schedule identifier.",
"in": "path",
"name": "schedule_id",
"required": true,
"schema": {
"description": "Immutable schedule identifier.",
"maxLength": 64,
"minLength": 1,
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateManualScheduleRunRequest"
}
}
},
"required": true
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateManualScheduleRunResponse"
}
}
},
"description": "Manual run created."
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RequestErrorResponse"
}
}
},
"description": "Invalid request or turn input."
},
"403": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RequestErrorResponse"
}
}
},
"description": "The caller is not the schedule creator."
},
"404": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RequestErrorResponse"
}
}
},
"description": "Schedule or agent not found."
},
"409": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RequestErrorResponse"
}
}
},
"description": "Run name conflict (retry)."
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RequestErrorResponse"
}
}
},
"description": "The run cannot be started (e.g. agent resources unavailable)."
}
},
"summary": "Trigger a manual schedule run",
"tags": [
"Schedules"
],
"x-fern-sdk-group-name": [
"schedules"
],
"x-fern-sdk-method-name": "create_manual_run"
}
},
"/api/v1/sessions": {
Expand Down
71 changes: 71 additions & 0 deletions packages/trueforge-sdk/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,77 @@ await client.schedules.listRuns("schedule_id");
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.schedules.<a href="/src/api/resources/schedules/client/Client.ts">createManualRun</a>(schedule_id, { ...params }) -> TrueForge.CreateManualScheduleRunResponse</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Start a schedule run immediately (run-now) using the schedule task. Does not replace or advance the cron pending run.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```typescript
await client.schedules.createManualRun("schedule_id");

```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**schedule_id:** `string` — Immutable schedule identifier.

</dd>
</dl>

<dl>
<dd>

**request:** `TrueForge.CreateManualScheduleRunRequest`

</dd>
</dl>

<dl>
<dd>

**requestOptions:** `SchedulesClient.RequestOptions`

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down
Loading