Skip to content

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).

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.

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, not router: the check is yes or no, and a condition’s two edges must be labelled exactly "true" and "false". The expression is expr-eval, not JavaScript. Change 4 to set the number of questions.
  • No history in the prompts: each llm node’s rendered promptTemplate is its system prompt, and the model also receives the conversation so far, so the prompt does not need {{conversationHistory}}. That is how ask_question sees the last answer and the questions already asked.
  • streamOutput: false: the response nodes send the text; see streamOutput defaults to true.
  • respond_question has no outgoing edge: the turn ends there and the session stays open for the next answer. Only end_session ends the session.
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.

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.

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.