/

Identify target companies and roles

Google Spreadsheet with list of target company names
Google Spreadsheet with list of target company names

Identify target companies and roles

Creator

What's in this setup guide

In this guide, you'll set up an AI agent that will automatically generate a list of 5 new target companies every week. This is important because in the next guide, you need this list to identify specific people at those companies to connect with!

To set this up, we will:

1) Create a super simple spreadsheet to track targets who meet your ICP (ideal customer profile)

2) Build a simple AI agent that searches the web for target companies and roles

Here's a step-by-step setup guide on exactly how to do this. Since this might be your first agent, we'll spend a bit more time on some of the agent basics.

1. Create a target company & leads tracker in Google Sheets

First, you need to create a simple three-column database table so the AI agent has a place to add suggested target companies. To make this table, just create a copy of this Google Sheets template.

It has three columns in the Target Companies tab:

  1. Company Name: The name of the target company

  2. Company LinkedIn Profile URL: The link to the company's profile page on LinkedIn (this makes it easier for the AI to find people at these companies)

  3. Job Titles: One or more relevant job titles of target leads at that company

We'll come back to the second tab, Target Leads, in the next setup guide.

👉 Already using another database tool? If you're already using another tool like Airtable or Notion, feel free to make this table there instead! Just note that you'll need to choose automations for those apps instead (like Airtable "Add record to table" instead of Google Sheets "Add row to sheet"), so you need to be comfortable making adjustments to the default Relay.app agent templates we provide.



2. Seed the tracker with 2-5 companies and job titles

We're going to be asking an AI to find target companies and job titles for you. To help it find relevant targets, you need to first provide it with some good examples of what target companies and job titles look like for your business.

Examples are super instructive when you want to show an AI exactly the kind of information you are looking for. Add at least 2 examples of the kinds of companies and job titles you want to target.



3. Import the Target Company Finder AI agent template

Next, we're going create an AI agent in Relay.app. Every week, this agent is going to:

  • Identify 5 companies and job titles similar to the ones already in your sheet

  • Add each target opportunity as a new row in your sheet

To make this agent, just import this template: Target Company Finder

👉 Note for new users! If this is your first time using Relay.app, you'll be prompted to create a new account. Your free Relay.app account includes a reasonable number of free steps and AI credits every month. Every automation you run uses a step, and every AI step uses a number of AI credits depending on the size of the task. You can use your account for free until you outgrow the free steps and credits.



4. Take a look at the agent's triggering schedule (step #1)

Now we are going to walk through each step in the agent so you know how it works, and to make sure it's set up the way you want it to work.

First, the trigger. Every agent starts with a trigger. The trigger is the event that tells the agent it's time to wake up and run. In this case, we're using a scheduled trigger because we want the agent to run on a regular cadence.

Open the trigger and see how it's set to trigger every week, so every Monday you'll get a set of new target companies (as well as leads at those companies, in the next agent we build).



5. Attach your tracker to the AI step as a knowledge source (step #2)

Open the AI step to see how it's set up. This step prompts GPT-5 to conduct a search to find 5 target companies and roles at those companies that would make good leads. It makes the decision about what makes a good company/role based on the roles already in your tracker. Since it needs your tracker to make this decision, it's very important to give the agent access to your tracker!

👉 First, a bit of useful background about attaching data and knowledge sources. In general, there are two ways to attach data to an AI step:

  1. Attach data to the prompt directly as context

    Data attached directly is passed to the model in full along with the prompt. You'd do this when you want to make sure the AI reads everything you attach, like the full content of a specific email you are extracting from, or all the data about a specific customer in your CRM that you are analyzing.


  2. Attach data as a knowledge source for the AI to reference as needed (We're doing this one!)

    When data is attached as a knowledge source, the AI can use some preprocessing to determine what information in the tracker it needs to access. In this case, since your company tracker will get long, and it's not critical that every single piece of data in the tracker is sent to the model, we want to attach your tracker as a knowledge source. It's more efficient (and cheaper) than sending the entire spreadsheet to the AI in full every time the agent runs.

To do this, click the "Knowledge" button, select Google Spreadsheet, and attach your new tracker as a knowledge source.



Once the tracker is attached, you'll see a purple chip at the bottom of the prompt:



👉 If you used Airtable or Notion it's a bit different: These database types aren't yet supported as knowledge sources, so you'll need to attach your tracker as data rather than a knowledge source. Do this by 1) adding an Airtable Find records or Notion Find page in database automation before the AI step, then 2) clicking Data from previous steps and attaching the found file.

6. Review the loop (step #3)

Because the AI step is outputting a list of target companies, you need a loop to take action on each one of those companies individually. The loop already set up for you in the template:



7. Map the new target companies to your tracker (step #4)

Inside the loop, there is one Add row step. Because it's in a loop, this step will run once for every response from the AI—that is, for every target company that is generated by the AI step.

You'll need to set up this step yourself to make it point to your tracker. Here's how:

  1. If you see a button to connect Google Sheets, do that first

  2. Under Sheet, search for and select the tracker you made

  3. Click the Auto-suggest button under Fields to populate, and Relay.app should find your column names and automatically map the right data to them for you!

👉 If you're adding these fields manually: Click Add field and add your three columns as fields. Map data to these fields by selecting the [+] button and finding the corresponding data under the {} Responses menu.

👉 If you're using another database tool: You'll need to delete this step and instead use an automation to add to the database tool of your choice. The process for mapping fields is the same.



8. Publish your changes

Before you can test or run your agent, you might be prompted to publish the changes you made. Just click Publish.



9. Test your new agent!

Let's see how this new agent does. Click Start a test run to run it now. A test run is a real run, so the automations will really run!

What's nice about a test run is that it won't cost you any AI credits, so you can make sure it's working as you like before you turn the agent on.



When you start your test run, you'll be taken to the Runs view. When the test run is complete, you'll see the updates in your Google Sheet.



10. Make any necessary tweaks

Check your sheet. How did it do?

If you like the results, go ahead and turn the agent on! It will run automatically on the schedule you set.

If your results aren't exactly what you want, you may need to update the examples you gave to the AI in your sheet. (The prompt and the model used in the AI step are other levers you have as well.)

👉 Testing tip: If you need to make changes, you can speed up your iteration process by doing a step test rather than testing the whole workflow. Open the AI step and look for the Test this step button. Try a few changes to your Google Sheet or prompt and see if you get better results.

11. Turn it on!

When you're happy with how it's working, go ahead and turn the agent on!


Next, you'll built an agent to turn those target companies into leads

You now have your first working LinkedIn lead gen agent (👏)! But we need more than just a sheet of target companies. Next, we'll take those target companies and job titles and use those to find specific people you can connect with.