Event

trigger.invoiceninja_event
TriggerBusiness appsconnection requiredruns in-engine

Registers one Invoice Ninja webhook per event at publish and starts one run per delivery, authenticated by a token Mantle stores on the subscription.

Start a run when Invoice Ninja emits an event (invoice, quote, payment, client, task, expense…).

Connection

Required
Yes — the node will not save without one
Auth type
API key
Providers
Invoice Ninja
Secret shape
the API token, or {"api_token", "api_secret"}
Config it needs
base_url
Resolved by
config.connection_id, else node.connection_id
Note
The token must belong to an admin user on an account with the API feature — Invoice Ninja authorises webhook creation on isAdmin(), so a token that can read invoices can still fail to publish. A self-hosted install puts its own origin on the connection's base_url. Publishing also needs MANTLE_APP_PUBLIC_BASE_URL set to a URL the install can reach.

Configuration

1 field, none required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.

FieldTypeRequiredDefaultConstraintsExample
events
Which events to subscribe to. One Invoice Ninja webhook is registered per event and deleted again when the workflow is unpublished.
arrayNo["create_invoice"]1–25 characters; array of string—

Example configuration

Every value below is the contract’s own example or default — nothing invented.

{
  "events": [
    "create_invoice"
  ]
}

Output

One shape.

invoiceninja event

A flat envelope around the record Invoice Ninja sent. `payload` keys are whatever the entity's transformer emits, so the shape is open.

Extra keys beyond the ones listed can appear.

FieldTypeExample
event
Invoice Ninja's own event name, e.g. create_invoice. Branch on this when the trigger subscribes to more than one.
stringcreate_invoice
event_id
The numeric event id the subscription was registered with (2 for create_invoice). 0 when a delivery arrived without the event header.
number2
entity
What the event is about — invoice, quote, client, payment, credit, task, expense, vendor, product, purchase_order or project.
stringinvoice
action
What happened to it: create, update, delete, archive, restore, sent, approve, accepted, remind, late or expired.
stringcreate
entity_id
The record's hashed id (v5 ids are strings, not numbers) — feed it straight back to an invoiceninja.get_record node.
stringWpmbk5ezJn
updated_at
When the record last changed, epoch seconds. Part of the idempotency key.
number1719849600
payload
The record exactly as Invoice Ninja's transformer sent it — an Invoice for the invoice events, a Client for the client events, and so on.
object—
{
  "action": "create",
  "entity": "invoice",
  "entity_id": "Wpmbk5ezJn",
  "event": "create_invoice",
  "event_id": 2,
  "payload": {
    "amount": 420,
    "balance": 420,
    "client_id": "Opnel5aKBz",
    "due_date": "2024-07-31",
    "id": "Wpmbk5ezJn",
    "number": "0001",
    "status_id": "2",
    "updated_at": 1719849600
  },
  "updated_at": 1719849600
}

Notes

  • Publishing creates one subscription per event; unpublishing, disabling or archiving deletes them all. A workflow that is off is off at Invoice Ninja.
  • Invoice Ninja does not sign deliveries. Mantle stores a random token in the subscription's own header map and refuses any delivery that omits it.
  • One run per delivery, idempotent on event + record id + updated_at, so Invoice Ninja's five retries cannot start a second run.
  • Invoice Ninja deletes a subscription whose endpoint answers 404, 405 or 410 — which a retired workflow's callback does; publishing again re-creates it.

See Event run in a workflow.

In a technical demo we add the Invoice Ninja connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.