Automation library · Lead generation

Qualify LinkedIn AI automation leads with Unipile and OpenAI

Started by a clock, and works across Postgres. It hands the judgement calls to OpenAI. 20 steps, 2 branches, 2 loops or waits: a working afternoon to understand properly.

MediumCalls a model: OpenAI

20 stepsMedium: a working afternoon
2Branches: places the flow splits
2Loops or waits
1Service it connects to

The flow

Starts it 1Model 1Logic 10Service 8

The steps in the order they run, from what starts it.

  1. 1Schedule Trigger Every MidnightSchedule triggerStarts it
  2. 2Fetch LinkedIn Profile from UnipileHttp RequestService
  3. 3Select rows from a tablePostgresService
  4. 4Insert Lead into Nebula PostgresPostgresService
  5. 5Loop Over Items3Split In BatchesLogic
  6. 6Get Latest Linkedin PostHttp RequestService
  7. 7Prepare Latest Post ContextCodeLogic
  8. 8Is New Commentable Post?IfLogic
  9. 9Get Post CommentsHttp RequestService
  10. 10Prepare AI Engagement Context.CodeLogic
  11. 11AI Decide And Generate CommentOpen AiModel
  12. 12Parse AI DecisionCodeLogic
  13. 13IfIfLogic
  14. 14Comment Like via UnipileHttp RequestService
  15. 15Prepare Skip UpdateCodeLogic
  16. 16WaitWaitLogic
  17. 17Reattach Context After LikeCodeLogic
  18. 18Comment Post via UnipileHttp RequestService
  19. 19Reattach Context After CommentCodeLogic
  20. 20Execute a SQL queryPostgresService

How it's built

Starts on
A clock
Steps
20, with 2 branches, 2 loops or waits
Size
Medium: a working afternoon
Connects to
Postgres
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Postgres account, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Plan an afternoon. 20 steps is enough that you should read each one before running it.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 20 steps before you point it at anything that matters.