Skip to content

feat: add Inngest stage D interview assets workflow - #56

Open
StefanoFalco wants to merge 1 commit into
devfrom
StefanoFalco/inngest-stage-d-automation
Open

feat: add Inngest stage D interview assets workflow#56
StefanoFalco wants to merge 1 commit into
devfrom
StefanoFalco/inngest-stage-d-automation

Conversation

@StefanoFalco

Copy link
Copy Markdown

Related Issue:

No linked issue for now. This PR completes the Inngest migration for Stage D of the recruitment automation flow.

Description:

This PR adds the Stage D Inngest workflow for preparing the interview assets after an interview has been confirmed.

The implemented workflow:

  • waits according to the existing delayed scheduling logic;
  • verifies that the candidate is still in the expected Stage D before running;
  • loads the related applicant, interview, timeslot and interviewers;
  • copies an existing Google Docs report template using INTERVIEW_REPORT_TEMPLATE_ID;
  • renames the copied report document using the candidate/interview data;
  • places the copied report document inside INTERVIEW_REPORTS_FOLDER_ID;
  • creates a Google Calendar event for the interview;
  • generates a Google Meet link through the Calendar event;
  • saves the generated meetingId and reportDocId back into the interview record;
  • notifies HR and the verbose/log Telegram channel;
  • marks the related stage status as processed after successful execution.

This follows the same Inngest architecture introduced in the previous PR for Stages A, B and C. The workflow also keeps dry-run support, so local tests can simulate the Google Docs, Calendar and notification behavior without sending real external requests.

Implementation notes:

The report document is not created as an empty Google Doc. Instead, the workflow copies an existing Google Doc template, as required by the current recruitment process. The source document is configured through:

INTERVIEW_REPORT_TEMPLATE_ID

The destination folder is configured through:

INTERVIEW_REPORTS_FOLDER_ID

Validation:

  • I ran the Stage D dry-run helper smoke test.
  • I tested /recruitment/api/inngest-health.
  • I tested /recruitment/api/inngest.
  • I ran pnpm lint.
  • I successfully ran pnpm build.
  • I verified that this PR targets dev and not main.
  • I verified that this PR is based on the merged Inngest A/B/C work.
  • I reviewed the generated AI-assisted code before submitting.

@StefanoFalco

Copy link
Copy Markdown
Author

Final local validation completed for the Stage D PR.

I've checked:

  • Stage D function is registered in the Inngest functions index.
  • Stage D is triggered by event.data.stage == 'd'.
  • The workflow copies an existing Google Docs template through drive.files.copy.
  • The workflow uses INTERVIEW_REPORT_TEMPLATE_ID as source document and INTERVIEW_REPORTS_FOLDER_ID as destination folder.
  • The old “create empty Google Doc” behavior is not present anymore.
  • pnpm lint passes.
  • pnpm build passes.

I will wait for review before making further changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant