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

# Manage Schedule

> Pause, resume, or cancel a scheduled flow run

Manage the lifecycle of a scheduled flow run by pausing, resuming, or cancelling it.

## Available Actions

| Action   | Description                                                               |
| -------- | ------------------------------------------------------------------------- |
| `pause`  | Temporarily pause the schedule - it will not execute until resumed        |
| `resume` | Resume a paused schedule - it will continue executing as scheduled        |
| `cancel` | Permanently cancel the schedule - it cannot be resumed after cancellation |

## Examples

<AccordionGroup>
  <Accordion title="Pause a schedule">
    ```bash theme={null}
    curl --request POST \
      --url https://api.edges.run/v1/flows/schedules/550e8400-e29b-41d4-a716-446655440000/pause \
      --header 'X-API-Key: <your-api-key>'
    ```

    Temporarily stops the schedule from executing. Use this when you need to temporarily disable a recurring flow.
  </Accordion>

  <Accordion title="Resume a paused schedule">
    ```bash theme={null}
    curl --request POST \
      --url https://api.edges.run/v1/flows/schedules/550e8400-e29b-41d4-a716-446655440000/resume \
      --header 'X-API-Key: <your-api-key>'
    ```

    Reactivates a paused schedule. It will continue executing according to its cron schedule.
  </Accordion>

  <Accordion title="Cancel a schedule permanently">
    ```bash theme={null}
    curl --request POST \
      --url https://api.edges.run/v1/flows/schedules/550e8400-e29b-41d4-a716-446655440000/cancel \
      --header 'X-API-Key: <your-api-key>'
    ```

    Permanently cancels the schedule. This action cannot be undone.
  </Accordion>
</AccordionGroup>

## Status Transitions

Valid status transitions depend on the current state:

| Current Status | Valid Actions         |
| -------------- | --------------------- |
| `ACTIVE`       | `pause`, `cancel`     |
| `PAUSED`       | `resume`, `cancel`    |
| `CANCELLED`    | None (terminal state) |
| `COMPLETED`    | None (terminal state) |

## Use Cases

### Pause

* Temporarily disable automated flows during maintenance
* Stop execution while updating webhook endpoints
* Pause flows when you're over quota/budget

### Resume

* Reactivate flows after maintenance
* Continue automation after webhook updates
* Resume flows when quota is replenished

### Cancel

* Permanently stop flows that are no longer needed
* Clean up test schedules
* Remove outdated automation workflows

<Warning>
  **Cancelling is permanent** - Once a schedule is cancelled, it cannot be resumed. You would need to create a new schedule. Use `pause` if you might want to reactivate it later.
</Warning>

<Info>
  After managing a schedule, you can verify the change with [Get Schedule](/api/schedules/get) or view all schedules with [List Schedules](/api/schedules/list).
</Info>


## OpenAPI

````yaml POST /flows/schedules/{scheduled_flow_run_uid}/{action}
openapi: 3.1.0
info:
  title: ED Automation Flows API
  description: This is the Flows API documentation for ED Automation
  version: dev
servers:
  - url: https://api.edges.run/v1
security:
  - XApiKeyAuth: []
paths:
  /flows/schedules/{scheduled_flow_run_uid}/{action}:
    post:
      tags:
        - flows / schedules
      summary: Update the status of a scheduled flow_run
      parameters:
        - schema:
            type: string
          in: path
          name: scheduled_flow_run_uid
          required: true
          description: Scheduled flow_run UID
        - schema:
            type: string
            enum:
              - resume
              - cancel
              - pause
          in: path
          name: action
          required: true
          description: >-
            With this action, you can resume, cancel or pause the scheduled
            flow_run.
      responses:
        '200':
          description: Returns the updated scheduled flow_run
          content:
            application/json:
              schema:
                description: Returns the updated scheduled flow_run
                type: object
                properties:
                  uid:
                    type: string
                    format: uuid
                    description: A unique identifier for the scheduled flow run.
                  flow_preset_uid:
                    type: string
                    format: uuid
                    description: >-
                      A unique identifier for the flow preset associated with
                      this scheduled execution.
                  flow_preset_name:
                    type: string
                    description: >-
                      The human-readable name of the flow preset executed by
                      this schedule.
                  user_uid:
                    type: string
                    format: uuid
                    description: >-
                      A unique identifier for the user associated with this
                      scheduled flow run.
                  workspace_uid:
                    type: string
                    format: uuid
                    description: >-
                      A unique identifier for the workspace associated with this
                      scheduled flow run.
                  status:
                    type: string
                    enum:
                      - ACTIVE
                      - CANCELLED
                      - PAUSED
                      - COMPLETED
                    nullable: true
                    description: The current status of the scheduled flow run.
                  postponed_until:
                    type: string
                    format: date-time
                    nullable: true
                    description: >-
                      If the flow run is postponed, this field indicates when it
                      will be retried.
                  cron:
                    type: string
                    description: >-
                      The cron expression (in POSIX format) defining the
                      schedule for the flow run.
                    nullable: true
                  timezone:
                    type: string
                    description: The IANA timezone for the scheduled flow run.
                    nullable: true
                  next_execution_at:
                    type: string
                    format: date-time
                    description: The date and time of the next scheduled execution.
                    nullable: true
                  last_executed_at:
                    type: string
                    format: date-time
                    description: The date and time when the flow run was last executed.
                    nullable: true
                  created_at:
                    type: string
                    format: date-time
                    description: The date and time when the scheduled flow run was created.
                    nullable: true
                  updated_at:
                    type: string
                    format: date-time
                    description: >-
                      The date and time when the scheduled flow run was last
                      updated.
                    nullable: true
                additionalProperties: false
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/def-0'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/def-0'
components:
  schemas:
    def-0:
      title: APIError
      description: >-
        Represents an error returned by the API. This schema defines the
        standard structure of error messages to ensure consistent error handling
        across the application.
      type: object
      properties:
        error_label:
          type: string
          nullable: true
        error_scope:
          type: string
          enum:
            - input
            - integ
            - param
            - config
          nullable: true
        error_ref:
          type: string
          nullable: true
          example: ERR-12345
        message:
          type: string
        status_code:
          type: integer
          nullable: true
        params:
          type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: boolean
              - type: 'null'
              - type: array
                items:
                  type: string
          nullable: true
        data:
          type: object
          nullable: true
          additionalProperties: true
          description: Additional data about the error
      additionalProperties: false
  securitySchemes:
    XApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````