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

# Save a Scheduled Function draft

> Save new code as the draft of a Scheduled Function without changing what production runs. Returns the draft_hash that publishing requires.

Save new code for a Scheduled Function without changing what production runs. The published code keeps running on its schedule until you [publish the draft](/docs/en/api/scheduled-functions/publish-scheduled-function).

## How the draft works

* Each function has one draft, shared by the dashboard, the API, and the MCP. Each save replaces it.
* Only the code is drafted. The name, description, schedule, timezone, lookup scope, lead cap, and `is_active` change immediately with [Update](/docs/en/api/scheduled-functions/update-scheduled-function).
* Saving code identical to the published code leaves no draft, and `draft_hash` comes back `null`.
* Keep the `draft_hash` from the response: [Publish](/docs/en/api/scheduled-functions/publish-scheduled-function) requires it.

<Note>
  Sending `code` to [Update](/docs/en/api/scheduled-functions/update-scheduled-function) still publishes it immediately. Use this endpoint when the change should be tested first.
</Note>

## Next steps

1. [Test](/docs/en/api/scheduled-functions/test-scheduled-function) the draft.
2. Review the requests it would have sent and the previewed lead changes.
3. [Publish](/docs/en/api/scheduled-functions/publish-scheduled-function) it with that `draft_hash` as `expected_draft_hash`.


## API Specification

The full API specification for this endpoint is available in the [documentation index](https://docs.getnexor.ai/llms.txt).


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