👥 Generate employee numbers and ID cards with Google Sheets and Gmail
⚡ 10 views · 👥 HR & Recruitment
Description
New hire, new ID card, zero paperwork chaos. Called with an employee ID, this workflow looks up the employee in Google Sheets, assigns a unique employee number, renders a PDF ID card, and routes it to printing, a GA task, or digital activation. Every step logged.
Last updated: September 2026.
Quick overview
This workflow is called with an employee ID, looks up the employee in Google Sheets, ensures they have a unique employee number, and then creates or updates an ID card record, renders a PDF via an HTTP service, and optionally triggers printing or a GA task while logging events.
How it works
- Receives a workflow call containing an
employee_idand looks up the matching employee in the Google Sheets “Employees” sheet. - If the employee number is missing, generates a new employee number, checks for collisions in Google Sheets, and updates the employee row with the new value.
- If the employee photo URL is missing, appends an “ID Cards” record with
waiting_photo, creates a photo-request task in the “Tasks” sheet, and sends a request email via Gmail. - If a photo is available, finds any existing ID card row in the Google Sheets “ID Cards” sheet, generates or reuses a card ID and verification token, and creates or updates the ID card record.
- Sends an HTTP request to the ID card renderer service to generate a PDF using the employee data and verification URL.
- If rendering succeeds, updates the ID card row with the
digital_file_url, readsprint_modefrom the Google Sheets “Config” sheet, then either sends a print job via HTTP, creates a GA print task in Google Sheets, or marks the card as digitally activated, and finally appends an “id_card_generated” event. - If rendering fails, marks the ID card as failed, appends an “id_card_render_failed” event, and stops the workflow with an error.
Setup
- Add Google Sheets OAuth2 credentials and set
ONBOARDING_SHEET_URLto your onboarding spreadsheet containing the “Employees”, “ID Cards”, “Tasks”, “Events”, and “Config” sheets. - Add Gmail OAuth2 credentials and set
ONBOARDING_HR_EMAILto the recipient address for photo request emails. - Set environment variables for
ID_CARD_RENDERER_URL(PDF renderer endpoint) andID_CARD_VERIFY_BASE_URL(public base URL used to build verification links). - If using vendor printing, set
PRINT_VENDOR_URL, and set theprint_modevalue in the “Config” sheet toPRINT_API,GA_TICKET, orDIGITAL_ONLY.
Quick Answers
What if there is no photo yet?
The card is marked waiting_photo, a task goes to the Tasks sheet, and HR gets a request email.
How is the card delivered?
Per print_mode: vendor print API, GA ticket, or digital-only activation.
What if rendering fails?
The card is marked failed with an event logged, and the workflow stops with an error.
Additional info
Built with n8n. Need an assessment on your business? Feel free to reach out at https://khmuhtadin.com/consultation/
đź”— Nodes Used
Google Sheets, HTTP Request, Gmail, Stop and Error, Execute Workflow Trigger
📥 Import
Download workflow.json and import into n8n:
Workflow menu → Import from File