logo
Workshop

Vapi Workflow (Assistant Creation)

00:00 / 11:24

Vapi has updated how Workflows are used. Be sure to review the latest implementation below!

Updated: 2025.06.06

New way to implement the workflows in the app:

  • Set up a Global Prompt:

    • 1
    • For example “You are a voice assistant helping with creating new AI interviewers. Your task is to collect data from the user. Remember that this is a voice conversation - do not use any special characters.”
  • Modify the first Conversation Node:

    • 2
    • Add a prompt like “Greet the user. Inform them that you will get some information from them, to create a perfect interview. Ask the caller for data required to extract. Ask the questions one by one, and await an answer.”
    • On the right-hand menu click on “Extract Variables” tab, and add the variables, just like in the Gather node in the video.
    • level - The job experience level. - string - you can add enum values to make sure the data stays consistent
    • amount - How many questions would you like to generate? - number
    • techstack - A list of technologies to cover during the job interview. For example, React, Next.js, Express.js, Node and so on… - string
    • role - What role should would you like to train for? For example Frontend, Backend, Fullstack, Design, UX? - string
    • type - What type of the interview should it be? - string - you can provide enums here too
  • Modify the condition bubble to say something like “If user provided all the variables.” - you can click on the yellow bubble or the green edge to get it's condition in the right-side menu.

  • Add a new node - API request, and configure it exactly the same as shown in the video. Remember about adding the userid variable along the ones extracted from the conversation! 3

  • You can also configure custom messages for the current API Call status - request sent, recievied success response, and request failed:

3.1

Hint: you can remove the the conditional bubbles by simply removing the condition text. If you want to add the condition again, just click on the green edge line and write the condition down in the right-hand menu.
  • Add a Hang-Up node below.

  • The final Workflow should look like this:

    • 4
  • Save the Workflow, and copy it's ID. Paste it in the .env.local as NEXT_PUBLIC_VAPI_WORKFLOW_ID - same as in the video.

    • 5
  • Later in the course, when implementing vapi.start() method, instead of passing workflow's ID to the method as the first variable, we have to modify it a bit. vapi.start() checks if Agent was defined, and then falls back to Workflow if necessary, so we have to explicitly say that Agent is undefined - here is the updated handleCall method:

const handleCall = async () => {
    setCallStatus(CallStatus.CONNECTING);

    if (type === "generate") {
      await vapi.start(
        undefined,
        undefined,
        undefined,
        process.env.NEXT_PUBLIC_VAPI_WORKFLOW_ID!,
        {
          variableValues: {
            username: userName,
            userid: userId,
          },
        }
      );
    } else {
      let formattedQuestions = "";
      if (questions) {
        formattedQuestions = questions
          .map((question) => `- ${question}`)
          .join("\n");
      }

      await vapi.start(interviewer, {
        variableValues: {
          questions: formattedQuestions,
        },
      });
    }
  };
  • You can find all these changes in the source code provided in the Video Kit for the course.

0 Comments

glass-bbok

No Comments Yet

Be the first to share your thoughts and start the conversation.

tick-guideNext Lesson

Vapi Agent