Send Events
Send events to Inngest. Functions with matching event triggers will be invoked.
import { inngest } from "./client";
await inngest.send({
  name: "app/account.created",
  data: {
    accountId: "645e9f6794e10937e9bdc201",
    billingPlan: "pro",
  },
  user: {
    external_id: "645ea000129f1c40109ca7ad",
    email: "taylor@example.com",
  }
})
To send events from within of the context of a function, use step.sendEvent().
inngest.send(eventPayload | eventPayload[]): Promise
- Name
- eventPayload
- Type
- object | object[]
- Required
- required
- Description
- An event payload object or an array of event payload objects. Properties- Name
- name
- Type
- string
- Required
- required
- Description
- The event name. We recommend using lowercase dot notation for names, prepending - prefixes/with a slash for organization.
 
- Name
- data
- Type
- object
- Required
- required
- Description
- Any data to associate with the event. Will be serialized as JSON. 
 
- Name
- user
- Type
- object
- Required
- optional
- Description
- Any relevant user identifying data or attributes associated with the event. This data is encrypted at rest. Properties- Name
- external_id
- Type
- string
- Required
- optional
- Description
- An external identifier for the user. Most commonly, their user id in your system. 
 
 
 
- Name
- id
- Type
- string
- Required
- optional
- Description
- A unique id used to idempotently ingest a given event payload once (i.e. deduplication). 
 
- Name
- ts
- Type
- number
- Required
- optional
- Description
- A timestamp integer representing the time (in milliseconds) at which the event occurred. Defaults to the time the Inngest receives the event. - If the - tstime is in the future, function runs will be scheduled to start at the given time. This has the same effect as running- await step.sleepUntil(event.ts)at the start of the function.
 
- Name
- v
- Type
- string
- Required
- optional
- Description
- A version identifier for a particular event payload. e.g. - "2023-04-14.1"
 
 
 
// Send a single event
await inngest.send({
  name: "app/post.created",
  data: { postId: "01H08SEAXBJFJNGTTZ5TAWB0BD" }
})
// Send an array of events
await inngest.send([
  {
    name: "app/invoice.created",
    data: { invoiceId: "645e9e024befa68763f5b500" }
  },
  {
    name: "app/invoice.created",
    data: { invoiceId: "645e9e08f29fb563c972b1f7" }
  },
])
// Send user data that will be encrypted at rest
await inngest.send({
  name: "app/account.created",
  data: { billingPlan: "pro" },
  user: {
    external_id: "6463da8211cdbbcb191dd7da",
    email: "test@example.com"
  }
})
// Specify the idempotency id, version, and timestamp
await inngest.send({
  // Use an id specific to the event type & payload
  id: "cart-checkout-completed-ed12c8bde",
  name: "storefront/cart.checkout.completed",
  data: { cartId: "ed12c8bde" },
  user: { external_id: "6463da8211cdbbcb191dd7da" },
  ts: 1684274328198,
  v: "2024-05-15.1"
});
User data encryption 🔐
All data sent in the user object is fully encrypted at rest.
⚠️ When rerunning a function, event.user will be empty. This will be fixed in the future, but for now assume that you cannot rerun functions that rely on event.user data.
In the future, this object will be used to support programmatic deletion via API endpoint to support certain right-to-be-forgotten flows in your system. This will use the user.external_id property for lookup.
Send Events via HTTP (Event API)
You can send events from any system or programming language with our simple API and an Inngest Event Key. The API accepts a single event payload or an array of event payloads.
To send an event to a specific branch environment, set the x-inngest-env header to the name of your branch environment, e.g. x-inngest-env: feature/my-branch.
curl https://inn.gs/e/$INNGEST_EVENT_KEY \
  --data '{
    "name": "user.signup",
    "data": {
      "userId": "645ea8289ad09eac29230442"
    }
  }'
Response
{
  "ids": ["01H08W4TMBNKMEWFD0TYC532GG"],
  "status": 200
}
Usage limits
See usage limits for more details.