mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-18 22:54:24 +01:00
Docs: Scheduling recipes - Desktop and Temporal (#3452)
This commit is contained in:
@@ -108,6 +108,8 @@ These variables control how Goose manages conversation sessions and context.
|
|||||||
| `GOOSE_CONTEXT_STRATEGY` | Controls how Goose handles context limit exceeded situations | "summarize", "truncate", "clear", "prompt" | "prompt" (interactive), "summarize" (headless) |
|
| `GOOSE_CONTEXT_STRATEGY` | Controls how Goose handles context limit exceeded situations | "summarize", "truncate", "clear", "prompt" | "prompt" (interactive), "summarize" (headless) |
|
||||||
| `GOOSE_MAX_TURNS` | [Maximum number of turns](/docs/guides/smart-context-management#maximum-turns) allowed without user input | Integer (e.g., 10, 50, 100) | 1000 |
|
| `GOOSE_MAX_TURNS` | [Maximum number of turns](/docs/guides/smart-context-management#maximum-turns) allowed without user input | Integer (e.g., 10, 50, 100) | 1000 |
|
||||||
| `GOOSE_CLI_THEME` | [Theme](/docs/guides/goose-cli-commands#themes) for CLI response markdown | "light", "dark", "ansi" | "dark" |
|
| `GOOSE_CLI_THEME` | [Theme](/docs/guides/goose-cli-commands#themes) for CLI response markdown | "light", "dark", "ansi" | "dark" |
|
||||||
|
| `GOOSE_SCHEDULER_TYPE` | Controls which scheduler Goose uses for [scheduled recipes](/docs/guides/recipes/session-recipes.md#schedule-recipe) | "legacy" or "temporal" | "legacy" (Goose's built-in cron scheduler) |
|
||||||
|
| `GOOSE_TEMPORAL_BIN` | Optional custom path to your Temporal binary | /path/to/temporal-service | None |
|
||||||
|
|
||||||
**Examples**
|
**Examples**
|
||||||
|
|
||||||
@@ -129,6 +131,12 @@ export GOOSE_MAX_TURNS=100
|
|||||||
|
|
||||||
# Set the ANSI theme for the session
|
# Set the ANSI theme for the session
|
||||||
export GOOSE_CLI_THEME=ansi
|
export GOOSE_CLI_THEME=ansi
|
||||||
|
|
||||||
|
# Use Temporal for scheduled recipes
|
||||||
|
export GOOSE_SCHEDULER_TYPE=temporal
|
||||||
|
|
||||||
|
# Custom Temporal binary (optional)
|
||||||
|
export GOOSE_TEMPORAL_BIN=/path/to/temporal-service
|
||||||
```
|
```
|
||||||
|
|
||||||
### Model Context Limit Overrides
|
### Model Context Limit Overrides
|
||||||
|
|||||||
@@ -458,7 +458,7 @@ goose recipe help
|
|||||||
|
|
||||||
---
|
---
|
||||||
### schedule
|
### schedule
|
||||||
Automate recipes by running them on a schedule using a cron job.
|
Automate recipes by running them on a [schedule](/docs/guides/recipes/session-recipes.md#schedule-recipe).
|
||||||
|
|
||||||
**Usage:**
|
**Usage:**
|
||||||
```bash
|
```bash
|
||||||
@@ -472,9 +472,13 @@ goose schedule <COMMAND>
|
|||||||
- `sessions`: List sessions created by a scheduled recipe
|
- `sessions`: List sessions created by a scheduled recipe
|
||||||
- `run-now`: Run a scheduled recipe immediately
|
- `run-now`: Run a scheduled recipe immediately
|
||||||
|
|
||||||
|
Use the following commands if you're scheduling recipes using the [Temporal scheduler](https://docs.temporal.io/evaluate/development-production-features/schedules) (requires the Temporal CLI):
|
||||||
|
- `services-status`: Check if any Temporal services are running
|
||||||
|
- `services-stop`: Stop any running Temporal services
|
||||||
|
|
||||||
**Options:**
|
**Options:**
|
||||||
- `--id <NAME>`: A unique ID for the scheduled job (e.g. `daily-report`)
|
- `--id <NAME>`: A unique ID for the scheduled job (e.g. `daily-report`)
|
||||||
- `--cron "* * * * * *"`: Specifies when a job should run using a 6-field [cron expression](https://en.wikipedia.org/wiki/Cron#Cron_expression) represented as a string in the format "seconds minutes hours day-of-month month day-of-week"
|
- `--cron "* * * * * *"`: Specifies when a job should run using a [cron expression](https://en.wikipedia.org/wiki/Cron#Cron_expression) represented as a string with either 5, 6, or 7 digits in the format "seconds minutes hours day-of-month month day-of-week year"
|
||||||
- `--recipe-source <PATH>`: Path to the recipe YAML file
|
- `--recipe-source <PATH>`: Path to the recipe YAML file
|
||||||
- `--limit <NUMBER>`: (Optional) max number of sessions to display when using the `sessions` command
|
- `--limit <NUMBER>`: (Optional) max number of sessions to display when using the `sessions` command
|
||||||
|
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ You can turn your current Goose session into a reusable recipe that includes the
|
|||||||
Using a recipe with the Goose CLI might involve the following tasks:
|
Using a recipe with the Goose CLI might involve the following tasks:
|
||||||
- [Configuring your recipe location](#configure-recipe-location)
|
- [Configuring your recipe location](#configure-recipe-location)
|
||||||
- [Running a recipe](#run-a-recipe)
|
- [Running a recipe](#run-a-recipe)
|
||||||
- [Scheduling a recipe](#schedule-a-recipe)
|
- [Scheduling a recipe](#schedule-recipe)
|
||||||
|
|
||||||
#### Configure Recipe Location
|
#### Configure Recipe Location
|
||||||
|
|
||||||
@@ -383,19 +383,6 @@ You can turn your current Goose session into a reusable recipe that includes the
|
|||||||
- Your session won't affect the original recipe creator's session
|
- Your session won't affect the original recipe creator's session
|
||||||
:::
|
:::
|
||||||
|
|
||||||
#### Schedule a Recipe
|
|
||||||
Automate Goose recipes by running them on a schedule.
|
|
||||||
|
|
||||||
**Create a schedule** - Create a scheduled cron job that runs the recipe on the specified cadence.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Add a new scheduled recipe which runs every day at 9 AM
|
|
||||||
goose schedule add --id daily-report --cron "0 0 9 * * *" --recipe-source ./recipes/daily-report.yaml
|
|
||||||
```
|
|
||||||
The [cron expression](https://en.wikipedia.org/wiki/Cron#Cron_expression) follows the format "seconds minutes hours day-of-month month day-of-week".
|
|
||||||
|
|
||||||
See the [`schedule` command documentation](/docs/guides/goose-cli-commands#schedule) for detailed examples and options.
|
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
@@ -445,6 +432,49 @@ You can turn your current Goose session into a reusable recipe that includes the
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
|
## Schedule Recipe
|
||||||
|
<Tabs groupId="interface">
|
||||||
|
<TabItem value="ui" label="Goose Desktop" default>
|
||||||
|
Automate Goose recipes by running them on a schedule.
|
||||||
|
|
||||||
|
1. click the gear icon `⚙️` in the top right corner
|
||||||
|
2. Select **Scheduler**
|
||||||
|
3. Click **Create New Schedule**
|
||||||
|
3. In the dialog that appears:
|
||||||
|
- Provide a **Name** for the schedule
|
||||||
|
- Select the **Source** of your recipe. This can be either a `yaml` file or link generated by Goose Desktop.
|
||||||
|
- Select whether you want your recipe to run in the background or foreground. Recipes run in the background don't open a window, but the session results are saved. Recipes run in the foreground will open a window if the Goose Desktop app is running. Otherwise, the recipe runs in the background.
|
||||||
|
- Choose the **Frequency** and timing for your recipe. Your selected frequency (e.g. every 20 minutes, weekly at 10 AM on Friday) is converted into a [cron expression](https://en.wikipedia.org/wiki/Cron#Cron_expression) used by Goose.
|
||||||
|
- Click **Create Schedule**
|
||||||
|
|
||||||
|
Your new scheduled recipe is listed in the **Schedules Management** section. Click on the schedule to view details, see when it was last run, and perform actions with the scheduled recipe:
|
||||||
|
- **Run Schedule Now** to trigger the recipe manually
|
||||||
|
- **Edit Schedule** to change the scheduled frequency
|
||||||
|
- **Pause Schedule** to stop the recipe from running automatically.
|
||||||
|
|
||||||
|
At the bottom of the **Schedule Details** screen you can view the list of sessions created by the scheduled recipe and open or restore each session.
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
<TabItem value="cli" label="Goose CLI">
|
||||||
|
Automate Goose recipes by scheduling them to run with a [cron expression](https://en.wikipedia.org/wiki/Cron#Cron_expression).
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Add a new scheduled recipe which runs every day at 9 AM
|
||||||
|
goose schedule add --id daily-report --cron "0 0 9 * * *" --recipe-source ./recipes/daily-report.yaml
|
||||||
|
```
|
||||||
|
You can use either a 5, 6, or 7-digit cron expression for full scheduling precision, following the format "seconds minutes hours day-of-month month day-of-week year".
|
||||||
|
|
||||||
|
See the [`schedule` command documentation](/docs/guides/goose-cli-commands.md#schedule) for detailed examples and options.
|
||||||
|
|
||||||
|
When scheduling Goose recipes with the CLI, you can use Goose's built-in cron scheduler (default), or the [Temporal scheduler](https://docs.temporal.io/evaluate/development-production-features/schedules) (requires the Temporal CLI). Switch from the default legacy scheduler by setting the `GOOSE_SCHEDULER_TYPE` [environment variable](/docs/guides/environment-variables.md#session-management):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export GOOSE_SCHEDULER_TYPE=temporal
|
||||||
|
```
|
||||||
|
Use Temporal scheduling if you want an advanced workflow engine with monitoring features. The scheduling engines do not share schedules, so schedules created with the legacy Goose scheduler cannot be run with the Temporal scheduler, and vice-versa.
|
||||||
|
</TabItem>
|
||||||
|
</Tabs>
|
||||||
|
|
||||||
## Core Components
|
## Core Components
|
||||||
|
|
||||||
A recipe needs these core components:
|
A recipe needs these core components:
|
||||||
|
|||||||
Reference in New Issue
Block a user