Skip to main content

Screen CVs with OpenAI and PostgreSQL using chained prompts

Workflow preview

Workflow preview
100%
Screen CVs with OpenAI and PostgreSQL using chained prompts preview
Open on n8n.io

1. Workflow Overview

How it works Webhook receives a job ID and list of candidate IDs from your database If the job has no template yet, Prompt 0 reads the job description and automatically extracts mandatory requireme...

Best for

  • HR automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.webhook, n8n-nodes-base.postgres, n8n-nodes-base.if, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.code, n8n-nodes-base.splitinbatches

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Lucas Hideki.

Original n8n.io source

1.1 Workflow description

Title
Screen CVs with OpenAI and PostgreSQL using chained prompts
Workflow name
Screen CVs with OpenAI and PostgreSQL using chained prompts

How it works

  • Webhook receives a job ID and list of candidate IDs from your database
  • If the job has no template yet, Prompt 0 reads the job description and automatically extracts mandatory requirements, differentials, behavioral competencies and sets the weight of each criterion
  • For each candidate, 3 prompts run sequentially with accumulated context:
  • Prompt 1 scores the candidate (0–100) against the job template using calibration anchors to avoid score inflation, plus a breakdown score per criterion
  • Prompt 2 receives the score as context and identifies strengths with concrete resume evidence, separating critical gaps (missing mandatory requirements) from secondary gaps (missing differentials)
  • Prompt 3 receives the gaps as context and generates personalized interview questions for that specific candidate — not generic HR templates
  • Results are saved directly to PostgreSQL after each candidate
  • When all candidates are processed, Prompt 4 automatically generates an executive summary of the entire pool with recommendations on who to interview

Set up steps

  • Add your OpenAI credentials to all AI nodes (~2 min)
  • Add your PostgreSQL credentials to all Postgres nodes (~2 min)
  • Create the required tables using the SQL schema provided in the workflow sticky note (~5 min)
  • Trigger via POST /webhook/cv-analyze with { "job_id": 1, "candidate_ids": [1, 2, 3] }

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Database Schema

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Input Format

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Prompt 0 Section

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Candidate Loop Section

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Summary Section

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Receive CVs

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 8 - Fetch Job and Candidates

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 9 - Job Template exists?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 10 - Prompt 0 — Extract Job Template

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 2.1

Block 11 - Save Job Template

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 12 - Prepare Candidates

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Loop Candidates

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 14 - Prompt 1 — Score

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 2.1

Block 15 - Prompt 2 — Gaps

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 2.1

Block 16 - Prompt 3 — Interview Questions

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 2.1

Block 17 - Build Analysis Payload

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Save Analysis

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 19 - Update Candidate Status

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 20 - Check Pending Candidates

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 21 - All Candidates Processed?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 22 - Update Job Status

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 23 - Fetch Full Pool

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 24 - Fetch Job for Summary

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Showing the first 24 of 27 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Screen CVs with OpenAI and PostgreSQL using chained prompts
Complexity advanced
Nodes 27
Categories HR, AI Summarization
Author Lucas Hideki
Published 04 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13876/13876.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Screen CVs with OpenAI and PostgreSQL using chained prompts do?

How it works Webhook receives a job ID and list of candidate IDs from your database If the job has no template yet, Prompt 0 reads the job description and automatically extracts mandatory requireme...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your HR, AI Summarization use case.