Onfleet ACTION
Create Linked Pickup & Dropoff Tasks
Create a pickup task and dropoff task linked with each other. See the docs here
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Onfleet account once, then configure and run Create Linked Pickup & Dropoff Tasks from your backend or agent.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "onfleet-create-pickup-dropoff-task",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
onfleet: { authProvisionId: "apn_xxxxxxx" },
merchant: "Merchant",
executor: "Executor",
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "onfleet-create-pickup-dropoff-task",
"configured_props": {
"onfleet": { "authProvisionId": "apn_xxxxxxx" },
"merchant": "Merchant",
"executor": "Executor"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "onfleet",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "onfleet-create-pickup-dropoff-task",
arguments: {
merchant: "Merchant",
executor: "Executor",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
merchant Merchant | string | The ID of the organization that will be displayed to the recipient of the task. Defaults to the creating organization. If you perform deliveries on behalf of a connected organization and want to display their name, logo, and branded notifications, provide their organization ID. Required Dynamic |
executor Executor | string | The ID of the organization that will be responsible for fulfilling the task. Defaults to the creating organization. If you delegate your deliveries to a third party, provide their organization ID. Required Dynamic |
hasPickupRecipient Has A Pickup Recipient | boolean | If the pickup have a recipient who should be notified of task status changes. Required |
hasDropoffRecipient Has A Dropoff Recipient | boolean | If the dropoff have a recipient who should be notified of task status changes. Required |
latitude Destination Latitude | string | The Latitude of the destination. Optional |
longitude Destination Longitude | string | The Longitude of the destination. Optional |
street Address Line 1 | string | If coordinates used, this will be for display purposes only. Coordinates will be relied on for actual location. Used for the number and name of the street. Required |
apartment Address Line 2 | string | For display purposes only. Used for Apartment, suite or other descriptive information. Optional |
city Address City | string | If coordinates used, for display purposes only. Coordinates will be relied on for actual location. Required |
state Address State / Province | string | If coordinates used, for display purposes only. Coordinates will be relied on for actual location. Required |
postalCode Address Post Code / Zip | string | If coordinates used, for display purposes only. Coordinates will be relied on for actual location. Required |
country Address Country | string | If coordinates used, for display purposes only. Coordinates will be relied on for actual location. Required |
taskLinkOrder Task Link Order | integer | The order in which to create the linked task relationship. By default, the pickup is created as the prerequisite to the dropoff. Choose "Dropoff first" to reverse this order, requiring completion of the dropoff before the pickup. Required |
autoAssign Assignment | string | Assignment type Required |
quantity Quantity | integer | The number of units to be dropped off while completing this task, for route optimization purposes. Optional |
serviceTime Service Time | integer | The number of minutes to be spent by the worker on arrival at this task's destination, for route optimization purposes. Optional |
signatureRequirement Signature Requirement | boolean | A signature must be collected to complete this task. Required |
photoRequirement Photo Requirement | boolean | A photo must be collected to complete this task. Required |
notesRequirement Notes Requirement | boolean | Task completion notes must be submitted to complete this task. Required |
minimumAgeRequirement Minimum Age Requirement | integer | The recipient's ID must be scanned and their age verified to be greater than or equal to the minimumAge in order to complete the task. Must be in a plan that supports ID verification. Optional |
completeAfter Complete After | integer | A timestamp in unix time for the earliest time the task should be completed, in milliseconds precision. Optional |
completeBefore Complete Before | integer | A timestamp in unix time for the latest time the task should be completed, in milliseconds precision. Optional |
notes Notes | string | Notes for the task. Field length cannot exceed 10,000 characters. Optional |
appearance Appearance | object | Set triangle colored pins on the map. Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- onfleet-create-pickup-dropoff-task
- Version
- 0.0.2
- App
- Onfleet
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗