> For the complete documentation index, see [llms.txt](https://superfluid.gitbook.io/superfluid/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://superfluid.gitbook.io/superfluid/developers/automations/stream-scheduler.md).

# Stream Scheduler

Superfluid's contract template for simplifying automation of stream start and end dates

## What’s the Stream Scheduler?

The Stream Scheduler allows you to:

1. Schedule when an existing stream is to be closed
2. Schedule when to start a new stream
3. Schedule when to start a new stream and when that new stream is to be closed

This feature can be be used directly in the Superfluid Dashboard after getting [approved for access](https://use.superfluid.finance/schedulestreams) or by making use of the underlying contracts in conjunction with off-chain automations (detailed in documentation here).

## Why Schedule Streams?

If you have an intended end date and/or start date for a stream, instead of having to *manually* trigger the action, you could use the Stream Scheduler to *automatically* trigger the action at the desired time. This is especially useful in the case of streaming payroll, subscriptions and token vesting.

Superfluid streams are perpetual by default - they run until you cancel them or you run out of balance. If you want to be streaming someone tokens for a fixed duration and not have to deal with manually triggering the creation or deletion of the stream, the Stream Scheduler is the solution.

## Example:

(view these Miro diagrams [here](https://miro.com/app/board/uXjVP--AM4I=/?share_link_id=524959909457))

1\.  It’s January 1st. You give the Stream Scheduler contract [operator permissions](https://docs.superfluid.finance/superfluid/developers/constant-flow-agreement-cfa/cfa-access-control-list-acl) and then schedule a stream with the below details:

*Flow Rate*: 100 DAIx/mo.\
*To*: Alice’s account\
*Start*: March 1st, 2023 at 12:00am\
*End*: March 20th, 2023 at 12:00am

<figure><img src="https://422548309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKEcOOf_qoYMObicyRu%2Fuploads%2FitXBLkPAXsvgXry31XKe%2Fimage.png?alt=media&amp;token=7b3843d0-e461-44bf-99df-9e1810e6ef33" alt=""><figcaption></figcaption></figure>

2\.  March 1st comes and the stream is initiated from you to Alice.

<figure><img src="https://422548309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKEcOOf_qoYMObicyRu%2Fuploads%2Fm5Vc3ONgbolqjlFfjbAx%2Fimage.png?alt=media&amp;token=b22cf8ff-a1e9-4fd8-86c4-7d448e2989e5" alt=""><figcaption></figcaption></figure>

3\.  March 20th comes and the stream from you to Alice is cancelled.

<figure><img src="https://422548309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKEcOOf_qoYMObicyRu%2Fuploads%2FcXtEO4pwVK0DjMJYqCpO%2Fimage.png?alt=media&amp;token=2c1263da-88f7-4c83-ac44-9eaf9a2e813a" alt=""><figcaption></figcaption></figure>

## Setting Up Stream Scheduling

{% embed url="<https://superfluidhq.notion.site/Setting-Up-Stream-Scheduling-551888de690e402caee50e8d87cb6930>" %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://superfluid.gitbook.io/superfluid/developers/automations/stream-scheduler.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
