When the app sends webhooks
Most modern apps can push events to a URL. This is the best option when it’s available: point the app’s webhook at a webhook trigger.- Define a
defineWebhookSourcewith apayloadschema for the app’s event. - Get the URL with
luno triggers url <endpoint>and register it in the app’s settings. - Put event-type constraints (literals, enums) in the
payloadschema so only the events you care about fire.
src/triggers/stripe-invoice-paid.ts
endpoint, each with its own payload for its event.
When the app doesn’t push events
If an app has no webhooks (or you’d rather pull), use a poll trigger. Itsrun() checks the app’s API on a schedule and starts a run only when there’s something new:
src/triggers/new-issues.ts
run(), or read them from your project’s credentials.
Chat apps: the Slack gateway
Conversations are different from events. To let people talk to an agent from Slack (mention it in a channel or DM it), connect the Luno OS Slack App (luno connect slack --kind luno; catalog slug slackbot) and use the Slack gateway rather than a trigger. The gateway delivers inbound messages to an agent and posts replies back as the bot. See external channels.
Finding integrations
To react to an app, call its API from an action inside a poll’srun(), or point its webhooks at Luno OS as above. See integrations for connecting apps.
Next steps
Webhooks
Receive events the app pushes to a URL.
Polling
Pull events from an app on a schedule.
External channels
Connect agents to Slack and other chat surfaces.
Integrations
Connect the apps you use.