Replace part of the current n8n-based recruitment automation flow with Inngest, so stage-related side effects are managed closer to the Next.js app and can be delayed, canceled, and extended with event/webhook-based logic.
The main goal is to stop executing some stage automations immediately on stage change. Instead, when a relevant stage change happens, the app should create an Inngest workflow that runs later and can still be canceled before execution.
Requirements:
- use Inngest as the background workflow/scheduling solution alongside Next.js
- trigger workflows from stage changes in the app, instead of relying only on n8n triggers
- support delayed execution, starting with a default delay of
1 hour
- support cancellation before the delayed action is executed
- support sleeping-hour scheduling rules, for example:
- if
event time + 1 hour is before 9:00 PM, run at that time
- if
event time + 1 hour is 9:00 PM or later, run the next day at 9:00 AM
- convert all the times to Rome timezone GMT+1/CET
- keep the workflow design extensible so future automations can also be triggered from webhooks/events
Current Automations:
- Step A: send the email confirming receipt of the application using a Google Docs template rendered through the shared email templating function, then notify the HR and log Telegram channels through the shared notification function
- Step B: send the interview booking email, including the booking link generated from the current application data, using the shared email templating function, then notify the HR and log Telegram channels through the shared notification function
- Step C: notify HR when a candidate selects an interview slot using the shared notification function
- Step D: create the interview report document, create the calendar event and meeting link, save the generated data back into the interview record, then notify HR using the shared notification function
- Shared email templating function: load the correct Google Docs template and replace placeholders with application or interview data. Considering using a library like jinja.
- Shared notification function: route notifications to the correct Telegram channel depending on the event type
Suggested order:
- Add Inngest to the project and connect it to the Next.js app.
- Identify which stage changes should emit application events.
- Create a shared scheduling rule to compute the actual execution time.
- Implement delayed Inngest functions for the selected stage automations.
- Add cancellation logic so a later change can stop a pending workflow.
- Verify the migrated flow works without depending on n8n for those steps.
Acceptance criteria:
Replace part of the current n8n-based recruitment automation flow with Inngest, so stage-related side effects are managed closer to the Next.js app and can be delayed, canceled, and extended with event/webhook-based logic.
The main goal is to stop executing some stage automations immediately on stage change. Instead, when a relevant stage change happens, the app should create an Inngest workflow that runs later and can still be canceled before execution.
Requirements:
1 hourevent time + 1 houris before9:00 PM, run at that timeevent time + 1 houris9:00 PMor later, run the next day at9:00 AMCurrent Automations:
Suggested order:
Acceptance criteria: