{
  "id": "26HXhIUZTZRzi06i",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Automate Recrutei Candidate Creation from n8n Forms with AI Vacancy Matching",
  "tags": [],
  "nodes": [
    {
      "id": "a3f36a51-3315-4e82-a1bb-75d622c90fca",
      "name": "On Form Submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        400,
        224
      ],
      "parameters": {
        "options": {
          "buttonLabel": "Submit",
          "appendAttribution": false,
          "respondWithOptions": {
            "values": {
              "formSubmittedText": "Your application has been successfully submitted."
            }
          }
        },
        "formTitle": "Job Application Form",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Full Name",
              "placeholder": "Enter your full name",
              "requiredField": true
            },
            {
              "fieldType": "email",
              "fieldLabel": "Email",
              "placeholder": "Enter your primary email",
              "requiredField": true
            },
            {
              "fieldType": "number",
              "fieldLabel": "Phone",
              "placeholder": "Enter your phone number (with area code)",
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Vacancy",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Javascript Developer"
                  },
                  {
                    "option": "Python Developer (Mid-level)"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "file",
              "fieldLabel": "Resume",
              "multipleFiles": false,
              "acceptFileTypes": "pdf"
            }
          ]
        },
        "formDescription": "Apply for the job of your choice."
      },
      "typeVersion": 2.3
    },
    {
      "id": "834651b7-adb1-41c2-bc9b-89d81bce622d",
      "name": "Create Prospect in Recrutei",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "It get only the first pipe stage",
      "position": [
        1520,
        224
      ],
      "parameters": {
        "url": "https://api.recrutei.com.br/api/v2/prospects",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "name",
              "value": "={{ $('On Form Submission').item.json['Full Name'] }}"
            },
            {
              "name": "pipe_stage_id",
              "value": "={{ $json.id }}"
            },
            {
              "name": "vacancy_id",
              "value": "={{ $('Set Vacancy ID').item.json.id }}"
            },
            {
              "name": "email",
              "value": "={{ $('On Form Submission').item.json.Email }}"
            },
            {
              "name": "telephone",
              "value": "={{ $('On Form Submission').item.json.Phone }}"
            },
            {
              "name": "prospect_acquisition_channel_id",
              "value": "8"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer [token]"
            },
            {
              "name": "Content-Type",
              "value": "multipart/form-data"
            }
          ]
        }
      },
      "executeOnce": true,
      "typeVersion": 4.2
    },
    {
      "id": "cbabd885-7609-424c-baad-830b5d43d5ec",
      "name": "Get Pipe Stages",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1312,
        224
      ],
      "parameters": {
        "url": "=https://api.recrutei.com.br/api/v1/vacancies/{{ $json.id }}/pipes",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer [token]"
            }
          ]
        }
      },
      "executeOnce": true,
      "typeVersion": 4.2
    },
    {
      "id": "416ed197-fa3f-4bc4-8ae9-0f8081727c9c",
      "name": "Get Vacancy ID from AI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        672,
        224
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "GPT-4.1-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Vacancy: {{ $json.Vacancy }}"
            },
            {
              "role": "system",
              "content": "you are a HR assistant, your job is to verify the vacancies publish on Recrutei and return its ID based on the title the user is going to give you.\n\nYou must return ONLY the ID number"
            }
          ]
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "a89cba85-6181-4801-bb04-87d0ae27568e",
      "name": "Set Vacancy ID",
      "type": "n8n-nodes-base.set",
      "position": [
        1008,
        224
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d7360277-e289-4a75-8e4b-bc2649868006",
              "name": "id",
              "type": "number",
              "value": "={{ $json.message.content }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "97426226-6ddd-4ce7-8dd2-88ae3da09980",
      "name": "Recrutei's MCP",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        816,
        432
      ],
      "parameters": {
        "options": {},
        "endpointUrl": "YOUR_MCP_ENDPOINT_URL_HERE"
      },
      "typeVersion": 1.2
    },
    {
      "id": "2d200089-8760-4fb2-8914-578b0f8c5e64",
      "name": "Add Curriculum as Observation",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2224,
        240
      ],
      "parameters": {
        "url": "https://api.recrutei.com.br/api/v1/talents-observations",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "application_id",
              "value": "={{ $('Create Prospect in Recrutei').first().json.data.application.id }}"
            },
            {
              "name": "talent_id",
              "value": "={{ $('Create Prospect in Recrutei').first().json.data.talent.id }}"
            },
            {
              "name": "talent_observation_type_id",
              "value": "11"
            },
            {
              "name": "description",
              "value": "={{ $json.text }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer [token]"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f13824be-23ec-4914-a7c7-a41d9db3cf67",
      "name": "Extract Text from PDF Resume",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1984,
        240
      ],
      "parameters": {
        "options": {},
        "operation": "pdf",
        "binaryPropertyName": "Resume"
      },
      "typeVersion": 1
    },
    {
      "id": "192f481f-b99e-4a21-965d-5b3d4e4fd883",
      "name": "Merge Candidate Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        1776,
        240
      ],
      "parameters": {
        "mode": "chooseBranch",
        "useDataOfInput": 2
      },
      "typeVersion": 3.2
    },
    {
      "id": "53927426-ac46-416e-b709-46eadaccae45",
      "name": "Main Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        -320
      ],
      "parameters": {
        "width": 1072,
        "height": 304,
        "content": "## How it works\nThis workflow starts when a user submits an application form. It uses an AI tool (connected to your Recrutei MCP) to accurately find the correct Vacancy ID based on the title provided. The workflow then creates the new candidate in Recrutei's ATS and, finally, extracts the resume's text to attach it as an observation to the candidate's profile.\n\n## Setup steps\n1.  **Recrutei API Credential:** Create a Header Auth credential named 'Recrutei API' with 'Authorization' as the Header Name and 'Bearer YOUR_TOKEN_HERE' as the value. Select this credential in the 3 HTTP Request nodes.\n2.  **OpenAI:** Configure your API Key in the `Get Vacancy ID from AI` node.\n3.  **MCP Endpoint:** Replace the placeholder in the `Recrutei's MCP` node with your actual endpoint URL."
      },
      "typeVersion": 1
    },
    {
      "id": "f95d0b32-4ff3-472d-a5f2-1b1c68490167",
      "name": "Section 1: Capture & Enrich",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        112
      ],
      "parameters": {
        "color": 7,
        "width": 828,
        "height": 450,
        "content": "### 1. Capture & Enrich Data\nCaptures form data and uses AI + MCP to find the internal Vacancy ID."
      },
      "typeVersion": 1
    },
    {
      "id": "b5317708-19d5-4bd1-9464-094dda807980",
      "name": "Section 2: Create Candidate",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        112
      ],
      "parameters": {
        "color": 7,
        "width": 510,
        "height": 450,
        "content": "### 2. Create Candidate\nUses the Recrutei API to get the correct pipeline and create the new candidate."
      },
      "typeVersion": 1
    },
    {
      "id": "c120d515-6dcc-46d0-96a2-c2e0787d5d9c",
      "name": "Section 3: Process Resume",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1760,
        112
      ],
      "parameters": {
        "color": 7,
        "width": 700,
        "height": 450,
        "content": "### 3. Process Resume\nMerges the data, extracts text from the PDF, and adds it as an observation to the candidate."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "53932725-b477-4c52-ba4a-d9f56bf4a080",
  "connections": {
    "Recrutei's MCP": {
      "ai_tool": [
        [
          {
            "node": "Get Vacancy ID from AI",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Set Vacancy ID": {
      "main": [
        [
          {
            "node": "Get Pipe Stages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Pipe Stages": {
      "main": [
        [
          {
            "node": "Create Prospect in Recrutei",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On Form Submission": {
      "main": [
        [
          {
            "node": "Get Vacancy ID from AI",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Candidate Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge Candidate Data": {
      "main": [
        [
          {
            "node": "Extract Text from PDF Resume",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Vacancy ID from AI": {
      "main": [
        [
          {
            "node": "Set Vacancy ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Prospect in Recrutei": {
      "main": [
        [
          {
            "node": "Merge Candidate Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text from PDF Resume": {
      "main": [
        [
          {
            "node": "Add Curriculum as Observation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}