View as Markdown
Onfleet icon

Onfleet ACTION

Create New Task

Create a new task. 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 New Task 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-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)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create New Task inputs
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
pickupTask Pickup Task boolean
Whether the task is a pickup task.
Optional
recipientName Recipient Name string
The person to be notified that the dropoff is occurring.
Required
recipientPhone Recipient Phone string
The phone of the recipient.
Required
recipientNotes Recipient Notes string
Notes related the recipient or the destination like door codes, beware of dog, etc.
Optional
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
autoAssign Assignment string
Assignment type
Required
dependencies Dependencies string[]
An array of tasks which must be completed prior to this task.
Optional Dynamic
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
useMerchantForProxy Use Merchant For Proxy boolean
Override the organization ID to use the merchant orgID when set to true for this task only.
Optional
scanOnlyRequiredBarcodes Scan Only Required Barcodes boolean
Set restrictions to block the scanning of non-required barcodes.
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-task
Version
0.0.2
App
Onfleet
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes