> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Schedule a RasterFlow task

> Run a RasterFlow task such as build_mosaics on a schedule, pass each run's processing window to the task's date inputs, and verify a run before you resume.

A task schedule can run a Wherobots task, such as the **RasterFlow** `build_mosaics` task, in place of a script. Each run calls the task with the inputs you save on the schedule. To pass each run's window to the task, map the window to its date inputs.

You'll schedule a monthly Sentinel-2 median mosaic for Haskell County, Kansas. The run at midnight UTC on the first of each month covers the previous calendar month. For timing, execution identity, failure emails, and recovery, which work the same for every schedule, see [Create a schedule](https://docs.wherobots.com/develop/task-schedules/create-a-schedule.md) and [Monitor and recover](https://docs.wherobots.com/develop/task-schedules/monitor-and-recover.md).

## Before you start

* A [Wherobots account](https://docs.wherobots.com/get-started/wherobots-cloud/create-account.md) in an active Organization that can run [RasterFlow tasks](https://docs.wherobots.com/develop/rasterflow/rasterflow-tasks.md).
* The task's inputs. See [Find a task's inputs and outputs](https://docs.wherobots.com/develop/rasterflow/rasterflow-tasks.md#find-a-task%E2%80%99s-inputs-and-outputs). A schedule passes the same inputs as a [direct run](https://docs.wherobots.com/develop/rasterflow/rasterflow-tasks.md), so a direct run you've made can serve as a template, but you don't need one.
* For the REST API tab, a [Wherobots API key](https://docs.wherobots.com/get-started/wherobots-cloud/api-keys.md), `curl`, and `jq`.

## How a task schedule runs

* **Choose the task by name.** Wherobots resolves the name when you save the schedule. Each run uses the task's current version, so a RasterFlow release changes what later runs execute.
* **Inputs are fixed on the schedule.** Every run sends the inputs you saved. A run receives its window only through the inputs you map to **Window start** and **Window end**. See [Map the window to task inputs](https://docs.wherobots.com/develop/task-schedules/scripts-and-windows.md#map-the-window-to-task-inputs).
* **Script settings don't apply.** A RasterFlow task runs on RasterFlow compute. The schedule has no **Runtime**, **Arguments**, or **Timeout (seconds)** settings; set the task's own inputs under **Task inputs**.
* **The schedule can't change the task.** It runs the task as Wherobots publishes it. To run your own code, create a schedule with a custom script.

## Configure the schedule

Create the schedule paused, run one explicit window, check the result, then resume it. **Run manually** starts a billable RasterFlow run.

> [tab] Cloud UI
>
> **1. Choose the task**
>
> Open [**Scheduled Tasks**](https://cloud.wherobots.com/scheduled-tasks) and choose **Create a schedule**. Select **Create paused**.
>
> Under **What do you want to run?**, choose **Wherobots task**. Enter a **Schedule name**, for example `haskell-monthly-s2`. In **Wherobots task**, choose **Choose a task**, then the entry that ends in `build_mosaics`. The list shows each task as its display name followed by its task name. The form loads the task's input schema.
>
> **Region** offers only the regions the task runs in; see [RasterFlow regions](https://docs.wherobots.com/develop/rasterflow/rasterflow-tasks.md#region). When the task runs in one region, as `build_mosaics` does, the form shows that region without a list.
>
> ![Create a schedule form: Create paused checked, the Wherobots task tab selected, schedule name haskell-monthly-s2, task Build imagery mosaics (build\_mosaics) selected, and region AWS US West (Oregon) (aws-us-west-2)](https://mintcdn.com/wherobots/otpgeYWTEnMgjTDX/images/develop/task-schedules/schedule-a-rasterflow-task/choose-task.png?fit=max\&auto=format\&n=otpgeYWTEnMgjTDX\&q=85\&s=24586ce854a339a630fb6ec667ed95bb)
>
> The create form with Create paused selected and build\_mosaics chosen under Wherobots task
>
> **2. Map the processing window**
>
> Under **Processing window**, set **Window start** to **Start time** and **Window end** to **End time**. These are the titles of the task's `start` and `end` inputs. Each list holds **Not mapped** and the task's date-time inputs that the other bound doesn't use. A mapped input leaves the **Task inputs** form, because each run fills it in.
>
> ![Processing window section with Window start set to Start time and Window end set to End time](https://mintcdn.com/wherobots/otpgeYWTEnMgjTDX/images/develop/task-schedules/schedule-a-rasterflow-task/processing-window.png?fit=max\&auto=format\&n=otpgeYWTEnMgjTDX\&q=85\&s=2fa489d20db290fb417e8541ce2b293c)
>
> Window start mapped to Start time and Window end mapped to End time
>
> If the task has no date-time inputs, the section shows **This task has no inputs that can be bound to the processing window.**
>
> **3. Set the task inputs**
>
> Under **Task inputs**, fill in the inputs the task needs. The form labels each input with its title, and an asterisk marks a required input. For this example, set:
>
> * **Area of interest** (`aoi`): `s3://wherobots-examples/rasterflow/aois/haskell.parquet`
> * **Imagery datasets** (`datasets`): select `s2_median`
> * **Output CRS** (`target_crs`): `EPSG:32614`
>
> Leave the other inputs empty to use the task's defaults; the schedule doesn't save an empty input. When an input value doesn't match the schema, **Create schedule** shows **Check task inputs** and lists each problem by input name, for example `min_coverage: 2 is greater than 1.`
>
> ![Part of the build\_mosaics Task inputs form: s2\_median checked under Imagery datasets, Pixel size left empty, and Output CRS set to EPSG:32614](https://mintcdn.com/wherobots/otpgeYWTEnMgjTDX/images/develop/task-schedules/schedule-a-rasterflow-task/task-inputs.png?fit=max\&auto=format\&n=otpgeYWTEnMgjTDX\&q=85\&s=7fc2e760190cf13137389c8e55cce72c)
>
> Imagery datasets with s2\_median selected, and Output CRS set to EPSG:32614
>
> **4. Set the timing and identity**
>
> Choose **Advanced cron**, enter `0 0 1 * *`, and choose `UTC`. See [Create a schedule](https://docs.wherobots.com/develop/task-schedules/create-a-schedule.md#configure-the-schedule) for the timing modes, **Run as**, and **Notification email recipients**. Then click **Create schedule**.
>
> On a short interval, leave time between runs for a RasterFlow run's state to update; see [Overlap](https://docs.wherobots.com/develop/task-schedules/scripts-and-windows.md#overlap).
>
> **5. Run an explicit window**
>
> The window to run is October 2026 in UTC: `2026-10-01T00:00:00Z` to `2026-11-01T00:00:00Z`. **Window start** and **Window end** use your display time zone, read when the dialog opens. To enter UTC, turn off **Show times in local timezone** in your [Settings preferences](https://cloud.wherobots.com/settings#preferences) before you open the dialog.
>
> Choose **Run manually** and enter the bounds:
>
> * In UTC, enter 12:00 AM on October 1, 2026 and 12:00 AM on November 1, 2026.
> * In Pacific time, enter 5:00 PM on September 30, 2026 and 5:00 PM on October 31, 2026, as the run history in the next step shows.
>
> Then click **Start run**. The run sends these bounds to `start` and `end` in UTC.
>
> **6. Verify the run**
>
> Find the run under **Run history**. **Window** shows the bounds in your display time zone. When its outcome is **Succeeded**, click **Details ↗** to open the RasterFlow run.
>
> ![Run history with one manual run: window Sep 30, 5:00 PM to Oct 31, 5:00 PM PDT, source Manual, outcome Succeeded, cost Not reported, and Rerun and Details links](https://mintcdn.com/wherobots/otpgeYWTEnMgjTDX/images/develop/task-schedules/schedule-a-rasterflow-task/run-history.png?fit=max\&auto=format\&n=otpgeYWTEnMgjTDX\&q=85\&s=6a656176ca6ee93854e0d17812be1c74)
>
> A succeeded manual run of the October 2026 UTC window, shown in Pacific time
>
> The RasterFlow run page lists the run's **Inputs**, including `start` and `end` in UTC, and its **Outputs**, including `mosaic_index_uri`. Compare them with [Verify your schedule](#verify-your-schedule).
>
> **7. Resume recurring execution**
>
> When the output is correct, click **Resume**, then **Resume schedule**. The schedule shows **Active**. Once the scheduler applies the change, **Next run** shows midnight UTC on the first of next month, in your display time zone.

> [tab] REST API
>
> **1. Read the task's inputs**
>
> Set the API key and URL, then read the task. `GET /tasks/{taskName}` returns its input schema. `GET /tasks` lists the tasks visible to your Organization, one page at a time.
>
> ```bash theme={"system"}
> export WHEROBOTS_API_KEY="YOUR-API-KEY"
> export API="https://api.cloud.wherobots.com"
> REGION="aws-us-west-2"
>
> curl -sSf -H "X-API-Key: $WHEROBOTS_API_KEY" "$API/tasks/build_mosaics" \
>   | jq '{regions, required: .inputSchema.required,
>          dateInputs: [.inputSchema.properties | to_entries[]
>                       | select(.value.format == "date-time") | .key]}'
> ```
>
> The command prints:
>
> ```json theme={"system"}
> {
>   "regions": [
>     "aws-us-west-2"
>   ],
>   "required": [
>     "aoi",
>     "datasets",
>     "end",
>     "start"
>   ],
>   "dateInputs": [
>     "end",
>     "start"
>   ]
> }
> ```
>
> `dateInputs` lists the inputs you can map to the processing window: `start` and `end` for `build_mosaics`.
>
> **2. Create a paused schedule**
>
> Select the task with `task.taskName`, and map the window with `contextInputs`:
>
> ```bash theme={"system"}
> TRIGGER_ID=""
> if TRIGGER=$(jq -n --arg region "$REGION" '{
>   name: "haskell-monthly-s2",
>   task: {
>     taskName: "build_mosaics",
>     inputs: {
>       datasets: ["s2_median"],
>       aoi: "s3://wherobots-examples/rasterflow/aois/haskell.parquet",
>       target_crs: "EPSG:32614"
>     }
>   },
>   contextInputs: { start: "windowStart", end: "windowEnd" },
>   region: $region,
>   triggerKind: "schedule",
>   triggerConfig: { cronExpression: "0 0 1 * *", timezone: "UTC" },
>   paused: true
> }' | curl -sS --fail-with-body -X POST -H "X-API-Key: $WHEROBOTS_API_KEY" \
>   -H "Content-Type: application/json" --data-binary @- "$API/triggers") &&
>   TRIGGER_ID=$(printf '%s\n' "$TRIGGER" | jq -er '.triggerId // empty'); then
>   printf '%s\n' "$TRIGGER" | jq '{triggerId, state, task: {taskId: .task.taskId, name: .task.name}, contextInputs}'
> else
>   TRIGGER_ID=""
>   printf '%s\n' "${TRIGGER:-}" >&2
>   printf '%s\n' 'No schedule ID received; stop. If the API returned no rejection, search for the schedule before you retry.' >&2
> fi
> ```
>
> The request returns `201`, and the command prints the following. Your IDs differ. If the command receives no schedule ID, it prints any error the API returned and leaves `TRIGGER_ID` empty; don't continue to the next step. Without an API rejection, the schedule may exist anyway, so search for it as described below before you retry.
>
> ```json theme={"system"}
> {
>   "triggerId": "nt6dj6bav6e8ak",
>   "state": "PAUSED",
>   "task": {
>     "taskId": "53kty6kbw1rihy",
>     "name": "build_mosaics"
>   },
>   "contextInputs": {
>     "start": "windowStart",
>     "end": "windowEnd"
>   }
> }
> ```
>
> Every accepted request creates a new schedule. Before you retry a create, search for the name with `GET /triggers?search=haskell-monthly-s2`; `GET /triggers` returns one page at a time.
>
> These fields differ from a [script schedule](https://docs.wherobots.com/develop/task-schedules/create-a-schedule.md#configure-the-schedule):
>
> | Field | Description |
> | - | - |
> | `task.taskName` | The name of the task to run, as `GET /tasks` lists it. The response reports the resolved task in `task.taskId` and `task.name`. Send `task.taskName` or `task.definition`, not both. |
> | `task.inputs` | Fixed inputs that every run sends, keyed by the task's input names. They must match the task's `inputSchema`. |
> | `contextInputs` | Inputs that each run fills from its window, as `{"<task input>": "windowStart"}` or `"windowEnd"`. See [Map the window to task inputs](https://docs.wherobots.com/develop/task-schedules/scripts-and-windows.md#map-the-window-to-task-inputs). |
> | `region` | A region in both the task's `regions` and your Organization's `allowedRegions`, from `GET /organization`. |
>
> The response's `task.openProperties` lists the inputs that are neither fixed nor mapped. You can set them in `triggerInputs`.
>
> **3. Run an explicit window**
>
> Start one run for October 2026. This works while the schedule is paused.
>
> ```bash theme={"system"}
> TASK_RUN_ID=""
> if [ -n "${TRIGGER_ID:-}" ] && RUN_NOW=$(curl -sS --fail-with-body -X POST -H "X-API-Key: $WHEROBOTS_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{"windowStart": "2026-10-01T00:00:00Z", "windowEnd": "2026-11-01T00:00:00Z"}' \
>   "$API/triggers/$TRIGGER_ID/run-now") &&
>   TASK_RUN_ID=$(printf '%s\n' "$RUN_NOW" | jq -er '.taskRunId // empty'); then
>   printf '%s\n' "$TASK_RUN_ID"
> else
>   printf '%s\n' 'No schedule ID, or the run-now request failed or returned no taskRunId; stop here. With a schedule ID, inspect its run history before retrying.' >&2
> fi
> ```
>
> The run sends `2026-10-01T00:00:00Z` as `start` and `2026-11-01T00:00:00Z` as `end`. Each accepted request creates a separate run, so check the schedule's run history before you retry. If the API rejected the request, for example because the schedule is archived, `RUN_NOW` holds the reason; print it with `printf '%s\n' "$RUN_NOW"`.
>
> **4. Read the result**
>
> Poll the run until it leaves `PENDING`, `SUBMITTED`, `RUNNING` and `CANCELLING`. The state can [lag the RasterFlow run](https://docs.wherobots.com/develop/rasterflow/rasterflow-tasks.md#run-states), so poll every 30 seconds:
>
> ```bash theme={"system"}
> STATE=""
> RUN=""
> while [ -n "${TASK_RUN_ID:-}" ]; do
>   RUN=$(curl -sSf -H "X-API-Key: $WHEROBOTS_API_KEY" "$API/task-runs/$TASK_RUN_ID") || { STATE=""; break; }
>   STATE=$(printf '%s\n' "$RUN" | jq -er '.state // empty') || { printf '%s\n' 'Could not read task-run state; stop and retry polling.' >&2; STATE=""; break; }
>   printf '%s\n' "$STATE"
>   case "$STATE" in PENDING|SUBMITTED|RUNNING|CANCELLING) sleep 30 ;; *) break ;; esac
> done
> [ -n "$RUN" ] && printf '%s\n' "$RUN" | jq '{state, results}'
> ```
>
> The loop prints one state per poll, then the result. This run took about eight minutes from submission. The bucket, Organization and user folders in the URI are placeholders, and your IDs and timing differ:
>
> ```text theme={"system"}
> SUBMITTED
> ...
> RUNNING
> ...
> SUCCEEDED
> {
>   "state": "SUCCEEDED",
>   "results": {
>     "mosaic_index_uri": "s3://your-managed-storage-bucket/your-org/data/your-user/tasks/build_mosaics/mosaics/sphek4i94q42st/mosaic_index.parquet"
>   }
> }
> ```
>
> `results.mosaic_index_uri` points to the mosaic index. See [Task run results](https://docs.wherobots.com/develop/rasterflow/rasterflow-tasks.md#task-run-results).
>
> If a request or response parse fails, the loop stops with an error. An interruption is not a run outcome: run the loop again. If a `SUCCEEDED` run shows `results` as `null`, its outputs couldn't be read at that moment. Read the same run again with `GET /task-runs/$TASK_RUN_ID`; don't start another run.
>
> **5. Resume recurring execution**
>
> Resume only after the run is `SUCCEEDED` and its inputs and results match [Verify your schedule](#verify-your-schedule). This command checks the run you polled: its ID, its state, the October 2026 bounds in `start` and `end`, and a `mosaic_index_uri`. Then it resumes the schedule with the `version` from the create response, so it resumes only the configuration you tested:
>
> ```bash theme={"system"}
> if [ -n "$RUN" ] && printf '%s\n' "$RUN" | jq -e --arg id "$TASK_RUN_ID" '
>     .taskRunId == $id and .state == "SUCCEEDED"
>     and .inputs.start == "2026-10-01T00:00:00Z" and .inputs.end == "2026-11-01T00:00:00Z"
>     and (.results.mosaic_index_uri | type == "string" and length > 0)' > /dev/null; then
>   VERSION=$(printf '%s\n' "$TRIGGER" | jq '.version')
>   curl -sSf -X POST -H "X-API-Key: $WHEROBOTS_API_KEY" -H "Content-Type: application/json" \
>     -d "{\"version\": $VERSION}" "$API/triggers/$TRIGGER_ID/resume" | jq '{state, converged, nextFireTime}'
> else
>   printf '%s\n' "The run isn't a verified success; the schedule stays paused. If results is null, run the poll loop again." >&2
> fi
> ```
>
> The command prints:
>
> ```json theme={"system"}
> {
>   "state": "ACTIVE",
>   "converged": false,
>   "nextFireTime": null
> }
> ```
>
> `nextFireTime` stays `null` until `converged` is `true`; see [Read schedule status](https://docs.wherobots.com/develop/task-schedules/monitor-and-recover.md#read-schedule-status). If you receive `409`, the schedule changed after you created it, or it's archived. Read it into `TRIGGER` with `TRIGGER=$(curl -sSf -H "X-API-Key: $WHEROBOTS_API_KEY" "$API/triggers/$TRIGGER_ID")`, then review its `state`, configuration and `version`:
>
> * If `state` is `ARCHIVED`, stop. An archived schedule can't run again.
> * If the change is unintended, stop.
> * If an execution setting changed, such as the task, inputs, mappings, region or **Run as** identity, repeat the explicit-window and poll steps. The Resume block's check fits this example: the window in `start` and `end`, and a `mosaic_index_uri`. If the change breaks that, verify the new run's inputs and outputs against the new task and adapt the check.
> * A change such as a rename needs no new run.
>
> Then run the Resume block again without reading the schedule again; it resumes the `version` in `TRIGGER`. See [Handle version conflicts](https://docs.wherobots.com/develop/task-schedules/monitor-and-recover.md#handle-version-conflicts).

## Verify your schedule

Confirm that the manual run succeeded and that the RasterFlow run received the window you submitted as `start` and `end`, in UTC. A successful `build_mosaics` run returns a `mosaic_index_uri`. The Cloud UI shows both on the RasterFlow run page under **Inputs** and **Outputs**. Through the API, `GET /task-runs/{taskRunId}` returns them in `inputs` and `results`. For the October 2026 run, the response includes:

```json theme={"system"}
{
  "windowStart": "2026-10-01T00:00:00Z",
  "windowEnd": "2026-11-01T00:00:00Z",
  "inputs": {
    "aoi": "s3://wherobots-examples/rasterflow/aois/haskell.parquet",
    "end": "2026-11-01T00:00:00Z",
    "start": "2026-10-01T00:00:00Z",
    "datasets": [
      "s2_median"
    ],
    "target_crs": "EPSG:32614"
  }
}
```

If `start` and `end` are hours off from these UTC bounds, the window was entered in a different time zone from the one the dialog used; see [Manual runs and backfill](https://docs.wherobots.com/develop/task-schedules/scripts-and-windows.md#manual-runs-and-backfill).

## Change the task or its inputs

In the Cloud UI, open the schedule's **Configuration** tab and choose **Edit configuration**. To switch tasks, choose another entry in **Wherobots task**. If you have set inputs or mappings, the form shows **Replace this Wherobots task?**, because switching discards them from the draft. Choose **Replace task** to continue, or **Keep current task**. The saved schedule doesn't change until you save. A saved schedule can't switch between a Wherobots task and a custom script in the Cloud UI.

Through the API, send `PATCH /triggers/{triggerId}` with the current `version`:

* `task.taskName` switches the schedule to another task. The stored inputs and mappings must suit the new task.
* `task.inputs` and `triggerInputs` replace the whole stored map, as for scripts. See [Change script inputs](https://docs.wherobots.com/develop/task-schedules/monitor-and-recover.md#change-script-inputs).
* `contextInputs` replaces the whole mapping. `{}` removes every mapping. A required input that loses its mapping needs a fixed value in `task.inputs` or `triggerInputs` in the same request, or the update fails.

## Next steps

> [card] [Scripts and processing windows](https://docs.wherobots.com/develop/task-schedules/scripts-and-windows.md#map-the-window-to-task-inputs)
>
> Map the window to task inputs and choose a timing.

> [card] [Monitor and recover](https://docs.wherobots.com/develop/task-schedules/monitor-and-recover.md#rasterflow-task-runs)
>
> Inspect RasterFlow runs and rerun a window.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.