Skip to main content

LangGraph | gotoHuman

An AI agent built with LangGraph integrating gotoHuman to keep a human in the loop.

The agent can be triggered with the email address of a new lead (from a waitlist, newsletter signup or lead magnet) to draft a personalized initial email outreach that is reviewed by a human before it is sent out.

Set it up

Create a form

This example uses our "Sales Lead (Simple)" template. Select it when creating a new form. You will also enter a webhook that is called with the review response.

Deploy this agent

Clone our Next.js repo

https://github.com/gotohuman/demo-gth-langgraph-lead/

It uses our JS/TS SDK to send requests for human review

Deploy it (e.g. to Vercel) and set up your environment variables

OPENAI_API_KEY = sk-proj-XXX
GOTOHUMAN_API_KEY=XYZ
GOTOHUMAN_FORM_ID=abcdef123
POSTGRES_CONN_STRING="postgres://..."

Run it

Trigger your agent whenever you get your hands on a new lead:

HTTP POST [DEPLOY_URL]/api/agent

{
"email": "[email protected]"
}

Find a new request for review in your gotoHuman inbox as soon as the agent is done with its' research, drafted an outreach message and needs approval.