Help with n8n workflow – Capture email, generate token, and continue with appointment booking

Hi everyone,

I’m learning n8n on my own, just out of curiosity and a desire to automate some processes for my projects. I’m not a professional developer, but I get by with logic and stubbornness :sweat_smile:

I’m building a workflow where an agent (AI or bot) interacts with a user, asks for their email address, and once it gets that, it generates a unique token and sends it to the email provided by the user, so the client can then continue with an appointment booking process, using the token for validation.

Right now, I can make this work if I hardcode a predefined email address into the email-sending node, but what I really want is to capture the email the user provides during the chat, store it (maybe in a variable, a database like Airtable/Notion, or even just JSON), and use that same email as the recipient for the token email.

In short:

  • The user starts the conversation.
  • The agent asks for their email.
  • The email is stored.
  • A token is generated.
  • The token is sent to the provided email address.
  • The user continues the booking process by using that token for verification.

Some parts are already working, but I’m stuck on making the email dynamic and using it properly in later nodes (especially the email node).

Any tips, examples, or suggestions would be super helpful. I’m learning step by step and every bit of guidance makes a difference.

Thanks in advance!
If someone speaks Spanish and can help me, I would really appreciate it too.

1 Like

Hi and welcome to the community.
Have you tried to use the “let the model define this parameter” in the gmail tool for the mail sending?

This should tell the model to fill in the Email address to send it to.

2 Likes

I agree with your reply :100:

@EPK

Hello,

Hope all is good and well, so I would say, you can ensure this by making sure each nodes passes along the email, or, you can specify in the user prompt, and reference an earlier node with the contact number, you can place this expression also into the email node, or as suggested by others use the magic button to auto fill.

If you don’t mind sharing the workflow, I can provide an example of how this would work.

Bst regards,

Samuel

1 Like

@King_Samuel_David

Hi, Samuel!! Yes, of course, I’ll send it to you so you can give me an idea of how to connect it and how I would define it to capture the data through the agent’s conversation with the user. Then, once the user enters their email address, it should be captured automatically, a verification token should be generated, and it should be sent to the user’s email. As I said, I connect it one way, but if I define my email directly in the Gmail node, it works. Another issue is that the flow keeps generating tokens — it never stops.

Hi, crisl.
Yes, I understand what you’re telling me, but in this case I have ‘Gmail’ as a node, I’m not using it as a tool, so it doesn’t allow me to assign it automatically, and I have to define the email variable, but it’s capturing the data.

Oh now I see. Having the workflow in the forum would definitely help answering your question.

Hey @EPK

Did you resolve this? Feel free to send via message or upload here,

n8n attach workflow

Many thanks,

Samuel