> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qxlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom code trigger

> Start a flow from events in any of the 1,000+ apps in the catalog with the Custom Code Trigger, beyond the ready-made triggers.

The ready-made [triggers](https://docs.qxlabs.com/flows/nodes/triggers.md) cover the most common apps. The **Custom Code Trigger** covers everything else, letting a flow start from events in any of the 1,000+ apps in the catalog.

> [!NOTE]
>
> The AI builder can handle this node for you. Describe what you want out of the event on the **Chat** tab, and it writes the code for you. See [Build with AI](https://docs.qxlabs.com/flows/build-with-ai.md).

## Choosing the event

Three fields decide what your flow listens for. **Choose a trigger service** picks the app, **Choose a trigger action** picks which of that app's events you want, and **Trigger Account** picks which of your connected accounts to watch. Depending on the event, a few more fields appear for narrowing it down.

![The Custom Code Trigger with its service, action, and account fields filled in](https://mintcdn.com/qx-labs/ZJkiVX6zo-84vXkk/images/flows/nodes/custom-code-trigger/trigger-setup-light.png?fit=max\&auto=format\&n=ZJkiVX6zo-84vXkk\&q=85\&s=6a129a857107a72650c72c8eb3a253dd)

## Handling the event

When the event fires, its full details are handed to the **Code** field as `event`. The code pulls out the parts your flow needs and returns them, and each row you add under **Declared Outputs** becomes a value the rest of the flow can use.

**Pip Packages** and **Timeout (seconds)** work the same as on the [Custom Code](https://docs.qxlabs.com/flows/nodes/custom-code.md) node, for when you need extra libraries or more time.

> [!NOTE]
>
> Like any trigger, this one only listens while the flow's status is **Active**, and a flow can have just one trigger. See [Schedules and triggers](https://docs.qxlabs.com/flows/schedules-and-triggers.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.