Declaring a hook
OnAfter:
- Hook: Title
Locator: embedded://momor.ai/web.api/title
Frequency: Once
- Hook: RelatedQuestions
Locator: embedded://momor.ai/web.api/related-questions
OnTerminal: Completed- Hookstring
- The entry’s name, the workflow’s own label for it.
- LocatorstringRequired
- The registered hook to run.
- OnTerminalstringDefault
Completed - Which endings the hook follows.
CompletedFailedCancelledAlways - Frequencystring
- Once runs the hook on the run’s first matching ending only. Where absent, it runs on every matching ending.
Once
Which endings a hook follows
A turn replaced by an edit owes no hooks. A hook already requested by an earlier ending is still owed if an edit later opens an alternative turn.
Hooks Momor ships
Retries and idempotency
Each hook request carries a stable idempotency key. A hook that fails records hook.failed and is tried again, up to the deployment’s limit of five attempts by default; one that succeeds records hook.completed and never runs again. A hook with an effect outside Momor should use its key, so a retry does not repeat the effect.
Registered hooks onlyA hook is code registered with the deployment and bound by its locator. Hooks written as actions in the workflow file, and hooks that fire on events while a turn runs, are not available.