SimplaDocs
Free resource

Write a Go agent prompt that runs the same way every time

One candidate email means a table update, a Slack message, a calendar invite and a reply. The PDF shows the prompt structure behind the agent that does all four from a single label.

For Ops and HR leads building Superhuman Go agents

What you’ll be able to do

  • Write agent prompts as numbered steps, so the agent does the work in the same order every run.
  • Keep names, IDs and lists in a doc table instead of the prompt, so a change takes one edit.
  • Trigger the agent from a label you add yourself, so it runs when you want and doesn't burn tokens on every email.

What’s inside

  • A prompt skeleton with Goal, Context, Steps, Rules and Output format sections, filled in for a Monday client status email agent
  • A Reference section pattern that holds doc IDs and table IDs in one place
  • A Variables pattern: read the active staff list from a doc table at the start of every run, shown with an onboarding invite agent
  • How to find the doc and table IDs (the grid-... values) your prompt needs
  • Which connector permissions to set to Always allow
  • Pointers for building the same agent in code with the SDK, plus checklists to run before you save

Before you download

Do I need to be doing interview scheduling?
No. The video uses interview scheduling because it touches a table, Slack, a calendar and email in one run. The prompt structure works for any multi-step agent, and the PDF also includes client status emails and onboarding invites.
Which tools does the example agent connect to?
Superhuman Docs, Gmail or Outlook, Calendar and Slack, with Superhuman Mail writing the reply in your own voice.
Why use a label as the trigger?
An email-received trigger fires on every message, including the ones you don't want handled. A label fires only when you add it, so you choose which emails the agent works on.
Full transcript

All right, today I'm going to teach you how to build a Superhuman Go agent that does five or six different things across many different systems and could possibly automate away someone's entire job. Follow along with me as I show you how to build an agent like this step by step.

To set the context, if you've ever worked in HR or dealt with interviews, you know that it is a ton of work. There are so many follow-ups and emails that you have to send. For example, you may get an email like this from an individual: "Thanks for getting back to me. I'm interested in the role. I'm free October 7th at 10:30 a.m. for an interview."

This may seem simple, but there's so much that needs to be done. First off, if you are working in HR, you're going to get dozens, hundreds of these. You need to schedule those interviews during free times. You need to let your internal team know when this is happening. You need to create the actual calendar event and invite the right people. And of course, you need to keep your applicant tracking system up to date. There are a lot of things that need to be done just because of this one email. I'm going to show you how to simply add a label to this email and everything else will be done by an agent.

If this isn't your exact workflow, that's okay. This video is going to cover general principles for building agents that would allow you to do these kinds of multi-step processes.

I'm going to go to go.superhuman.com. Once I'm at go.superhuman.com, I can see my past tasks or I can, of course, build an agent for myself. I've already started building an agent, so I'm not going to press this right now. I'm going to go to the one that we've already started building.

When you have an agent set up, this is the configuration screen. This is where you're going to actually build the agent itself. You've got a name for your agent. Let's call it the Interview Scheduler. We're going to give it a description: it's going to schedule interviews, it's going to respond via email to the candidate, it's going to send a Slack message to the internal team, create a calendar invite, and more.

The next part of this agent, and the most important part of any agent really, is the prompt. The prompt tells the agent what to do again and again. This prompt is long, but because it's the most important part, I think it deserves its own screen. I'm going to break this down and show you why I did what I did. Don't worry, I'm not going to take ten minutes to run through this. It'll be done quickly, but it is really important in building your agent.

As far as principles go, here is our entire prompt. This is everything from a role and a goal all the way down to step four. Let's go through each one of these one by one and see what I did and why.

First off in my prompt, I give the agent a role and a goal. It's just that high level, telling the agent right away: this is your role, this is your goal, this is what you're going to do.

Then I have a reference section. The idea of a reference section is simply that: things for the agent to reference. Now, I could scatter these throughout my steps, but having a specific section makes it easier for me as a human. If I need to come change these later, I can easily find them in the reference section and change all those pieces. Really, this is less for the agent and more for the human if they have to change this information later down the road.

Next, you'll see I actually put the words "step one" into the prompt itself. This isn't just here for a glorified slide. I wrote step one. It's good to give your agents sequential steps. Don't just say, hey, you need to schedule an interview and send a Slack message. What if they do those in different orders? So first, I say step one, and I'm letting them know exactly what they need to do and where.

First, I tell them that all interviews are kept track of and scheduled in a table with an ID of this grid. That is inside of this Coda doc here, right? This is where me and my team are keeping track of every applicant to our job. We can add new ones, we can comment on them, we can change them. The agent is going to interact with us here as well.

I think this is generally just a good principle when you build agents: they shouldn't just act invisibly in the background on their own. Rather, agents should have a surface where they can be transparent about what they're doing and collaborate alongside you and your team. Docs is a wonderful surface for this. I can work and comment in here, and then the agent can come and collaborate alongside me inside of the doc.

Here we are back in our prompt. I'm telling it to keep track of it in here. When a label is added to an email, and we'll show this live at the end of the video, all working through, I say use the metadata about the email to find the sender's existing row, so it knows which row to actually update. Then it says when you find the matching row, update it with the new date and time of the interview. So it's going to pull out the date and time of the interview from the email and update it there.

Step two is about sending the Slack message. First, I give it the ID of the Slack channel that it should send its message to. Then I give it a format. Notice I use these curly brackets. I could just say, hey, send a message, and it would send whatever it thinks appropriate. But it's good to help guide the AI and tell it exactly what it should be doing. Using curly brackets like this tells the AI to insert variables there. So it's going to say the actual person's name, as well as the date and the time that the interview is scheduled for.

For step three, I said schedule the actual meetings with invitees in Google Calendar. I need to include the person who sent the email and the interview committee. This part, I think, is important. I want every single calendar invite to include the person who should be invited, as well as the interview committee.

You'll notice that I'm not holding the interview committee and those people's names inside of the prompt. I'm actually holding them inside of this document here, the interview committee. Again, I call this a variable: something that might change. Maybe someone's sick one day, or maybe you hire new people who are on your interview committee. Instead of having to go into my prompt, find that, and change it every single time, I just say the interview committee is in this table. I can then change it here inside of my applicant tracker, and every time the agent runs, it's going to read afresh who that interview committee is. So using variables inside your prompt is important.

If you want more tips and tricks like this, we actually have a huge PDF full of resources, tips, and tricks in the description below. You can go grab that and get a lot more information on this prompt construction.

Let's look at the last piece that I did inside of our prompt. Step four, I said respond to the email that originally triggered this. Let the sender know that their interview has been scheduled. Notice that I didn't give it a format for how to respond. This is using the Superhuman Mail MCP, and the Superhuman Mail MCP actually knows my unique voice. It catalogs all the emails that I send. So I already have trust and confidence that it's going to send an email that I feel is appropriate. Again, if I didn't want to worry about that, I could use the same format I used for my Slack message, giving it an exact format of how it should send that email.

So that is our prompt. There are only a couple more things that we need to do in order to get this agent going.

Next up is my trigger. There are a lot of triggers. Over here on the left-hand side, you'll see I have email received. I could do that, but I just don't want it to trigger on all these different emails and have useless runs. I want to be smart about the tokens and usage that I'm consuming. So I'm going to use label added. This is a way that I can quickly and manually trigger these on different emails. This is connected with my Gmail specifically, so if you need new labels, you have to go add them in your mail provider. I'm going to choose interview and I'm going to say add. I've now got an appropriate trigger.

Next up, I need to add my connectors. First off, I need to add Superhuman Docs, because it's going to be writing and reading in that doc. It is going to be writing, so we need to change this to always allow. For Gmail, Outlook, and Calendar, we need to change this to always allow. And lastly, it's going to be sending Slack messages. So let's go and add Slack. Notice here that you can just search these, and there's Slack. Add that, and X out.

All right, the agent is saved and ready to run. All we're going to need to do now is go trigger it. Triggering it is really easy. I'm in Superhuman Mail. I'm going to press the letter L on my keyboard, which adds a label. I'm going to add the label interview, and we should be able to go back here directly and see that running. You'll see this started on the left-hand side. It's running right now and working for us. If there are no issues with my connections or account pieces, it should work, and we can see what it's doing.

All right, here the agent is managing table rows, creating or updating events, and more. Let's go in and see what it did while we're waiting. Next interview date. There it is, it changed it. Let's see the activity itself. Yep, today at 1:26. It is 1:26 PM. You'll see that that was changed and those were updated. So that is the agent actually working inside of our document.

You can also see here is our Slack message that was sent, and here is the email that was sent back to her: "Hey Jordan, October 7th works perfectly. I'll send over a calendar invite shortly so you have all the details." Again, that was all done by simply adding the interview label to the email.

If you have any questions about building agents or how I constructed my prompt, let me know in the comments. And of course, if you want more tips and tricks on agent building, grab it in the description below.