Skip to main content
A polling trigger starts a workflow run whenever something new happens in an external service. The platform calls your trigger on a fixed interval; you check the service, return the new events, and hand back a bit of state so the next poll knows where it left off. Each event you return becomes the inputs of a triggered workflow run.

The class

Subclass BasePollingTrigger[Config] and implement poll:
Register it from the plugin:

How poll works

1

Called on a schedule

The platform invokes poll(ctx, state) every polling_interval seconds. state is whatever your previous poll returned (an empty dict on the first call).
2

Return new events

Return (events, new_state). Each event is a JSON-serializable dict whose keys match your outputs — those fields become the triggered run’s inputs.
3

Persist a cursor

Put a watermark (last-seen id/timestamp, or a set of processed ids) in new_state so the next poll only returns genuinely new events. The platform stores it for you between polls.
Return an empty list when nothing is new — that is the normal case, and it starts no runs. Only return an event the first time you see it; deduping via state is what keeps a run from firing twice for the same item.

Reading credentials

List the integration types the trigger needs in integrations, then read them from the context the same way a node does:
See Creating integrations for the credential model.

Errors

Raise IntegrationFailedError (from noxus_sdk.errors) when the external call fails — only the message crosses the sandbox boundary, so make it actionable. Don’t let an exception escape for an expected “nothing new” result; return an empty list instead.

Definition fields