Requirements
- You have read the API overview guide
- You have read the API quickstart guide
- You have read the API pick an integration method guide
Objects
Task
: the task object
Endpoints
POST /tasks
: create a taskPUT /tasks/:id
: create or update a task (idempotent)PATCH /tasks/:id
: update a taskPOST /tasks/batch
: bulk create tasksPUT /tasks/batch
: bulk create or update tasks (idempotent)PATCH /tasks/batch
: bulk update tasks
Approaches
The goal is to create a task in Fragment when an event occurs in your existing system. At a high-level, the steps are:- Trigger (in your system)
- Create / update task (in Fragment)
1. Create and forget.
This is the simplest approach. You create a task in Fragment and let the Fragment workflow handle the rest. The task will be processed by your team and closed when completed. This is the recommended approach for most use cases as there is no conflict with your existing system and clear separation of concerns. Fragment is responsible for the task management, and you’re responsible for the business logic. Example: onboarding a new user. When a new user completes onboarding in your system, you can automatically create a task in Fragment to let your team know about it. In the code, it might look like this:onboarding.py
To avoid double task creation and guarantee idempotency, we recommend using the
PUT /tasks/{uid}
endpoint instead of POST /tasks
.This requires that you generate a stable task ID that is consistent across retries. See Map task IDs for more details.2. Control the full task lifecycle.
In this approach, the status of the Fragment task is managed by your system. Maybe you create multiple tasks on Fragment for the same process on your side.It’s a good idea to read the Sync with existing objects guide.Even if you don’t have a clear 1:1 mapping between your existing system and Fragment tasks, it’s a similar setup (ID mapping, etc.).
- Data entry
- Review
- Approval
- Payment
- Create a task in Fragment at each step of the process
- Create a single task in Fragment at the beginning of the process and update the status at each step.
workflow.py