Skip to main content

Listeners

YepCode enables the creation of listeners that trigger executions based on events from external systems such as queues or mail servers.

tip

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:

New AMQP listener using a credential
const listener = yepcode.listener.amqp("my-amqp-queue");
listener.start((message) => {
console.log(`New message received`, message.content.toString());
})

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:

New AMQP listener that uses a other process webhook
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'
}
}
);
})

This approach allows for example to have only one listener and perform a router to trigger different processes depending on the message content.

info

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.