Event Bindings
Please contact us if you need access to this feature.
Event bindings and functions allow you to integrate Stedi with external systems and applications.
Event bindings automatically invoke your function asynchronously in response to events. For example, you could invoke a function for each transaction received from a specific trading partner.
Prerequisites
Before creating a binding, complete the following setup:
- Configure Stedi for at least one trading partner and process a test file ensure you can successfully process inbound files.
- Create and deploy a function where you want to add an event binding.
To test events and event bindings, you can deploy the following simple function that logs the events it receives.
Create an event binding in the UI
To configure an event binding:
- In Functions UI, open your function.
- On the Overview tab, click the Add Event Binding button to open the binding editor.
- In the binding editor, you can:
- Subscribe to one of the default Detail Types, like
transaction.processed.v2
, by selecting it from the list. - Create a custom binding. A custom binding allows you to filter a specific subset of events using a custom event pattern. Visit Creating custom event patterns for details.
- Subscribe to one of the default Detail Types, like
- Click Create.
Your event binding will take a minute or so to create. It’s ready once the status has changed from Under change to Available. Process a process a test file to try it out.
Visit Events for descriptions of every event type and full event structures.
Custom event patterns
Event patterns are simple JSON objects that have the same structure as the events that they match.
You only need to include the fields in your event pattern that you want to match on, and the values must always be an array. This approach allows a single pattern to match many different events.
The following example pattern would match any file.processed.v2
event when artifactType
is text/csv
.
Example event pattern
Example matching file.processed.v2
event for an incoming CSV
Send data to your downstream service
Instead of writing a custom function, you can use Destination webhooks to automatically send transactions and other events from Stedi to any third-party service. You can add event bindings that define which events should trigger the destination.