> For the complete documentation index, see [llms.txt](https://motivlabs.gitbook.io/impulse-user-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://motivlabs.gitbook.io/impulse-user-manual/using-impulse-headlessly/getting-started-with-curl/scheduling-jobs-with-pipelines.md).

# Scheduling Jobs and Pipelines

## Scheduling

The [scheduler](https://documenter.getpostman.com/view/12031716/UVsSP4EP?version=latest#1865746c-f37c-4ec2-bf72-60a16bcb3020) takes cron expressions to create schedules for when to run both sync and pipeline transactions.&#x20;

## Scheduling Jobs

### Creating a New Schedule

To create a new schedule for a job you can use the scheduler [/sync/config endpoint. ](https://documenter.getpostman.com/view/12031716/UVsSP4EP?version=latest#29585b97-7bfc-4466-a7e9-7cb274f4ad88)

To create a schedule for a job, you will need the job ID of the job you want to schedule and the cron expression for the schedule. This example creates a schedule that runs the job every minute.&#x20;

```
curl --request POST '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/scheduler/config' \
--header 'Content-Type: application/json' \
--data-raw '{
  "cronregexp": "* * * * *",
  "jobid": "{{job-id}}"
}'
```

The response will provide the `id` of the newly created schedule config. You can save this ID to later update the config.&#x20;

This endpoint can be used to create multiple schedules for the job.&#x20;

### Updating an Existing Schedule

To update an existing schedule you can use the scheduler's [/sync/config/{{config-id}} endpoint](https://documenter.getpostman.com/view/12031716/UVsSP4EP?version=latest#745a9b05-f562-4919-bb2c-2e49dce7cc02).

To update an existing schedule you will need the schedule config ID, the job ID, and the cron expression for the schedule. This example updates the schedule to run the job every 5 minutes.&#x20;

```
curl --request PUT '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/scheduler/config/{{config-id}}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "cronregexp": "*/5 * * * *",
  "jobid": "{{job-id}}"
}'
```

## Scheduling Pipelines

### Creating a New Schedule

To create a new schedule for a pipeline you can use the scheduler [/pipeline/config endpoint](https://documenter.getpostman.com/view/12031716/UVsSP4EP?version=latest#6c96ff90-28c9-4ffa-9621-9679cd33cb0c).

To create a schedule for a pipeline, you will need the pipeline ID of the pipeline you want to schedule and the cron expression for the schedule. This example creates a schedule that runs the pipeline every minute.&#x20;

```
curl --request POST '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/scheduler/pipeline/config' \
--header 'Content-Type: application/json' \
--data-raw '{
  "cronregexp": "* * * * *",
  "pipelineid": "{{pipeline-id}}"
}'
```

This endpoint can be used to create multiple schedules for the pipeline.&#x20;

### Updating an Existing Schedule

To update an existing schedule you can use the scheduler's [/pipeline/config/{{configID}} endpoint](https://documenter.getpostman.com/view/12031716/UVsSP4EP?version=latest#7cebd342-58f8-4990-9a2e-4ce93f62ef9b).

To update an existing schedule you will need the schedule config ID, the pipeline ID, and the cron expression for the schedule. This example updates the schedule to run the pipeline every 5 minutes.&#x20;

```
curl --request PUT '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/scheduler/pipeline/config/{{config-id}}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "cronregexp": "*/5 * * * *",
  "pipelineid": "{{pipeline-id}}"
}'
```

## Getting Schedules

You can get schedules either by ID or all the schedules at one time.&#x20;

The scheduler's [/config endpoint](https://documenter.getpostman.com/view/12031716/UVsSP4EP?version=latest#26a16023-3f69-4184-b067-3b9ca83935b5) can be used to retrieve all schedules created.&#x20;

```
curl --request GET '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/scheduler/config'
```

This will show all the schedules created both for job and pipelines.&#x20;

The scheduler's [/config/{{configID}} endpoint](https://documenter.getpostman.com/view/12031716/UVsSP4EP?version=latest#84ce83b3-8222-4d13-848e-a7dc2a5961c0) can be used to retrieve a single schedule.&#x20;

```
curl --request GET '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/scheduler/config/{{config-id}}'
```

This will show the single schedule for the passed in id.&#x20;

## Removing a Schedule

If you no longer want a schedule, you can remove it by using the [/config/{{configID}} endpoint](https://documenter.getpostman.com/view/12031716/UVsSP4EP?version=latest#497f6415-fe94-4d7c-bbe3-d32f8c0b045f).&#x20;

```
curl --request DELETE '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/scheduler/config/{{config-id}}'
```

This will remove the schedule so that it will no longer run.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://motivlabs.gitbook.io/impulse-user-manual/using-impulse-headlessly/getting-started-with-curl/scheduling-jobs-with-pipelines.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
