Overview
Day Copilot implements a draft/publish workflow that allows you to make changes to tasks and events without immediately affecting the published version. This is particularly useful for collaborative editing, review processes, and preventing accidental changes.The draft/publish workflow is optional. Simple updates (status changes, adding comments) can bypass drafting if needed.
How It Works
Version Numbers
Every task and event has two version numbers:| Property | Description |
|---|---|
version_major | Published version (e.g., 1, 2, 3) |
version_minor | Draft version (e.g., 1, 2, 3) |
is_published | Whether current state is published |
- Published version: 2.0 (last accepted state)
- Draft version: 2.3 (current working state with 3 edits)
- Status: Unpublished (changes not yet live)
State Machine
Creating a Draft
When you update a published task or event, it automatically becomes a draft:Example: Update Task
- Task was at version 1.0 (published)
- Your update created version 1.2 (draft)
last_livecontains the snapshot of version 1.0- Changes are not yet published
Publishing a Draft
To make your draft changes official, publish the draft:- Draft version 1.2 became published version 2.0
is_publishedset totruelast_livecleared (no longer needed)- Ready for new edits
Discarding a Draft
To revert to the last published version:- Draft changes discarded
- Reverted to last published state (version 1.0)
- All unpublished edits lost
Use Cases
1. Review Process
Example Workflow:- Developer updates task description (creates draft)
- Adds code examples (draft v1.2)
- Asks manager to review
- Manager approves → publish draft
- OR manager rejects → discard draft
2. Batch Editing
Make multiple changes without notifying collaborators until ready:3. Conflict Prevention
Two users editing the same task:Bypassing the Draft Workflow
Some operations don’t require drafting:Status Changes
Adding Comments
Quick Updates
Includepublish: true in update requests:
Querying Drafts
Get Only Published Items
Get Only Drafts
Include Draft Status
Version History
Access previous versions:Best Practices
Publish Frequently
Publish Frequently
Don’t leave drafts unpublished for extended periods. This can cause sync issues with collaborators.
Use Drafts for Major Changes
Use Drafts for Major Changes
Use the draft workflow for significant updates that benefit from review. Skip it for minor changes like status updates.
Handle Conflicts Gracefully
Handle Conflicts Gracefully
When publish fails due to conflicts, fetch the latest published version, merge changes manually, and republish.
Communicate Draft Status
Communicate Draft Status
In UI, clearly indicate when viewing a draft vs published version to avoid confusion.
Error Handling
Conflict Error
- Fetch latest published version (
GET /tasks/{id}) - Merge your changes with current state
- Create new draft with merged changes
- Publish
Next Steps
Managing Tasks Guide
See draft workflow in action
Tasks & Events Model
Understand the data model
API Reference
Explore draft endpoints
Error Handling Guide
Handle conflicts and errors