Recipe: First-Round Candidate Screening Agent
This recipe builds a first-round screening interview: the agent asks one question at a time with brief feedback on each answer, closes the interview after a set number of answers, ends the session, and leaves a structured evaluation (score, recommendation, strengths, weaknesses) for your systems to read.
It combines the INTERVIEW use case, a condition node on the built-in turnCount variable, and an end_session node with runEvaluation.
Every call uses a dashboard login: Authorization: Bearer <jwt> and x-huat-platform: customer (see Authentication).
Step 1: Create the agent
Section titled “Step 1: Create the agent”mutation CreateAgent($input: CreateAgentInput!) { createAgent(input: $input) { id }}{ "input": { "name": "Backend Engineer Screener", "position": "Technical Recruiter", "subject": "Backend engineer, first-round screening", "useCase": "INTERVIEW", "personaPrompt": "You are an experienced technical recruiter running a first-round screening interview for a backend engineering role. Ask one technical question at a time. After each answer, give one or two sentences of constructive feedback before the next question. Stay professional, warm and concise." }}useCase: INTERVIEW selects the interview evaluation (recommendation hire, maybe or no-hire), and subject tells it what the interview was for. The workflow’s llm nodes do not read personaPrompt, so the same persona text goes into their prompts in Step 2; keeping it on the agent too shows it in the dashboard. Assume the agent id is 74.
Step 2: Design the workflow
Section titled “Step 2: Design the workflow”Every message from the candidate runs the graph from start. turnCount counts the candidate’s messages in the session (1 for the first), so the condition decides between asking another question and closing:
flowchart TD start([start]) --> check{"check_turn_count: turnCount > 4"} check -- "false" --> ask[ask_question: llm] ask --> rq[respond_question: response] check -- "true" --> close[close_interview: llm] close --> rc[respond_close: response] rc --> finish([end_session, runEvaluation])The candidate’s first message (usually a greeting) gets the first question; answers 1 to 3 each get feedback and the next question; the fifth message, the answer to question 4, gets the closing message and ends the session.
Create the workflow:
mutation CreateWorkflow($input: CreateWorkflowInput!) { createWorkflow(input: $input) { id }}{ "input": { "name": "Backend Engineer Screening Interview", "description": "Asks four technical questions, closes politely and triggers the evaluation." }}Assume the workflow id is 55. Then save the graph:
mutation UpdateWorkflow($input: UpdateWorkflowInput!) { updateWorkflow(input: $input) { id }}{ "input": { "id": 55, "nodes": [ { "id": "start", "type": "start", "label": "Start", "config": {}, "position": { "x": 0, "y": 0 } }, { "id": "check_turn_count", "type": "condition", "label": "Four answers given?", "config": { "expression": "turnCount > 4" }, "position": { "x": 0, "y": 100 } }, { "id": "ask_question", "type": "llm", "label": "Ask the next question", "config": { "promptTemplate": "You are an experienced technical recruiter running a first-round screening interview for a backend engineering role. If the candidate has just answered a question, give one or two sentences of constructive feedback. Then ask exactly one new backend engineering question that has not been asked yet. Never ask more than one question.", "outputVar": "interviewerTurn", "streamOutput": false }, "position": { "x": -200, "y": 200 } }, { "id": "respond_question", "type": "response", "label": "Send the question", "config": { "messageTemplate": "{{interviewerTurn}}", "mood": "neutral" }, "position": { "x": -200, "y": 300 } }, { "id": "close_interview", "type": "llm", "label": "Write the closing message", "config": { "promptTemplate": "You are an experienced technical recruiter ending a first-round screening interview. Thank the candidate briefly and warmly and say the next steps will follow by email. Do not reveal any hire or no-hire decision.", "outputVar": "closingMessage", "streamOutput": false }, "position": { "x": 200, "y": 200 } }, { "id": "respond_close", "type": "response", "label": "Send the closing message", "config": { "messageTemplate": "{{closingMessage}}", "mood": "helpful" }, "position": { "x": 200, "y": 300 } }, { "id": "end", "type": "end_session", "label": "End the interview", "config": { "runEvaluation": true }, "position": { "x": 200, "y": 400 } } ], "edges": [ { "id": "e1", "source": "start", "target": "check_turn_count" }, { "id": "e2", "source": "check_turn_count", "target": "ask_question", "label": "false" }, { "id": "e3", "source": "check_turn_count", "target": "close_interview", "label": "true" }, { "id": "e4", "source": "ask_question", "target": "respond_question" }, { "id": "e5", "source": "close_interview", "target": "respond_close" }, { "id": "e6", "source": "respond_close", "target": "end" } ] }}Why it is built this way:
condition, notrouter: the check is yes or no, and acondition’s two edges must be labelled exactly"true"and"false". The expression is expr-eval, not JavaScript. Change4to set the number of questions.- No history in the prompts: each
llmnode’s renderedpromptTemplateis its system prompt, and the model also receives the conversation so far, so the prompt does not need{{conversationHistory}}. That is howask_questionsees the last answer and the questions already asked. streamOutput: false: theresponsenodes send the text; seestreamOutputdefaults totrue.respond_questionhas no outgoing edge: the turn ends there and the session stays open for the next answer. Onlyend_sessionends the session.
Step 3: Publish and attach
Section titled “Step 3: Publish and attach”mutation PublishWorkflow($id: Int!) { publishWorkflow(id: $id) { id isPublished version }}{ "id": 55 }mutation AttachWorkflow($id: ID!, $input: UpdateAgentInput!) { updateAgent(id: $id, input: $input) { id workflowId }}{ "id": "74", "input": { "workflowId": 55 } }A workflow runs only once published; see Wiring up a workflow.
Step 4: Read the evaluation
Section titled “Step 4: Read the evaluation”When end_session runs with runEvaluation: true, the evaluation is generated in the background after the session ends. Query it a few seconds later; it is null until the job has finished:
query ScreeningResult($sessionId: Int!) { evaluation(sessionId: $sessionId) { score recommendation summary strengths weaknesses generatedAt }}See Evaluation and Export for every field.
Getting the result into an ATS
Section titled “Getting the result into an ATS”Wetel does not push the evaluation to a URL you register (see outbound webhooks). Your backend notices the session ended (a SessionEndedEvent on the subscription, or polling session), reads evaluation, and sends it to your applicant tracking system with its own API. The workflow cannot do this step, because the evaluation does not exist until after the session ends.
Next steps
Section titled “Next steps”conditionnode: expression syntax for richer checks.end_sessionnode:runEvaluationandrequireConfirmation.- Persona and Prompt Engineering: writing the two prompts above.
- Configuring an Agent: use cases and their evaluations.