Listeners
YepCode enables the creation of listeners that trigger executions based on events from external systems such as queues or mail servers.
Listeners, combined with webhooks, transform YepCode into the ultimate swiss army knife for an event-driven architecture.
Listeners are configured using credentials similarly to integrations, providing all the necessary settings to connect to the source system and listen for events.
Once the listener is defined, you can start using it by providing a callback function to handle the received event payloads:
- JavaScript
- Python
const listener = yepcode.listener.amqp("my-amqp-queue");
listener.start((message) => {
console.log(`New message received`, message.content.toString());
})
Comming soon
We are releasing new Python features every week
You may perform a full event management in the provided callback function, but a very good practice is to isolate the event management logic into another YepCode process, and start an independent execution for each event:
- JavaScript
- Python
const axios = require('axios');
const listener = yepcode.listener.amqp("my-amqp-queue");
listener.start((message) => {
await axios.post(
'https://cloud.yepcode.io/api/{your-team-workspace}/webhooks/{your-other-process-slug}',
{
message: message.content
},
{
headers: {
'Authorization': 'Basic ...',
'Content-Type': 'application/json'
}
}
);
})
Comming soon
We are releasing new Python features every week
This approach allows for example to have only one listener and perform a router to trigger different processes depending on the message content.
Listeners require the use of long-lived executions and are available under our STARTER, GROWTH and ENTERPRISE plans.
Here are the listeners currently supported by YepCode. Explore them and stay tuned as we continue to add more every day. If you have specific requests or are interested in using other services, let us know.