DEV Community

zo Aoo
zo Aoo

Posted on

πŸš€ How I Built an AI Agent to Automate High-Converting Upwork Proposals (n8n + OpenAI)

As a freelancer or agency owner, the most unscalable part of the job is writing proposals.

Sending generic "I'm interested" messages gets you ignored. But spending 30 minutes crafting a bespoke strategy for a client who might never reply is a recipe for burnout.

I built a solution using n8n and LangChain. It's not just a text generator; it's a fully autonomous AI Agent that acts as my pre-sales team.

When I feed it an Upwork Job Description (JD), it automatically:

  1. ✍️ Writes a "Spartan" style cover letter (optimized for click-throughs).
  2. πŸ“„ Creates a custom Google Doc with a step-by-step execution plan.
  3. πŸ“Š Generates a Mermaid.js flowchart to visualize the solution.

Here is the breakdown of how I built this workflow and the prompt engineering behind it.


πŸ—οΈ The Architecture: Agents vs. Linear Workflows

Unlike a standard linear automation (Step A β†’ Step B β†’ Step C), this workflow uses an AI Agent structure.

Workflow Overview

Free Download JSON

The Components

  • The Brain (AI Agent): A LangChain node using GPT-4o-mini. It holds the context and decides which "Tools" to use.
  • Tool 1: Copy Generator: A sub-workflow specifically for writing the Upwork message body.
  • Tool 2: Proposal Generator: A sub-workflow that manipulates Google Drive and Docs.
  • Tool 3: Diagrammer: A sub-workflow that writes Mermaid.js code.

πŸ”§ Step 1: The "Anti-AI" Copywriting (The Hook)

Most AI-generated proposals sound like... AI. "I am thrilled to apply for your esteemed project." Delete.

I instructed the AI to use a "Spartan" tone. The goal is to sound like a busy expert, not a desperate salesperson.

The Prompt Strategy:
Inside the OpenAI node, I force a specific structure:

"Hi, I do {thing} all the time. So confident I created a demo: $$$"

Here is the actual system prompt used in the JSON:

Rules:
- $$$ is what we're using to replace links later on, so leave that untouched.
- Write in a casual, spartan tone of voice.
- Don't use emojis or flowery language.
Enter fullscreen mode Exit fullscreen mode

The workflow injects my specific achievements (e.g., "Scaled a content site from $10k to $92k/mo") into a variable called aboutMe, ensuring the social proof is real, while the context is AI-generated.

πŸ“„ Step 2: The Google Doc Automation (The "Meat")

This is the killer feature. The Agent doesn't just describe the plan; it delivers it as a tangible asset.

The Logic Flow:

  • AI Analysis: The LLM reads the JD and generates a structured JSON object containing a title, a brief explanation, and bullet points of the solution.
  • File Operations (Google Drive Node):
    • It copies a master Proposal Template I created beforehand.
    • It updates permissions to make it shareable (Anyone with link).
  • Variable Replacement (Google Docs Node):
    • It searches for placeholders in the Doc like {{stepByStepBulletPoints}} and {{leftToRightFlowWithArrows}}.
    • It replaces them with the specific strategy generated by the AI.

The result? The client receives a URL to a polished document that looks like I spent an hour writing it.

πŸ“Š Step 3: Visualizing the Solution (Mermaid.js)

To differentiate from other applicants, I added a visual element. The Agent creates a flowchart of the proposed automation/solution.

The Prompt:

Output your results in plaintext using Mermaid code formatting.
You only output flowcharts. Nothing else.
Example output:
graph TD;
    A-->B;
Enter fullscreen mode Exit fullscreen mode

The Output:

The agent produces code like graph TD; A[Lead In] --> B(CRM);, which I can either render immediately or paste into a viewer to include in the proposal. It proves technical competence instantly.

πŸ€– The Orchestrator (LangChain Agent)

The magic happens in the AI Agent node.

I gave the Agent a specific system instruction:

"When you receive an Upwork job description, you must generate a Mermaid diagram, a Google Doc proposal, and an Upwork application. You must then replace the '$$$' in the application copy with the Google Doc proposal link."

This "Tool Calling" capability allows the workflow to be dynamic. If the Google Doc generation fails, the agent knows it hasn't fulfilled the request yet.

πŸš€ How to Implement This Yourself

If you want to build this in n8n, here is your checklist:

  1. The Template: Create a Google Doc with {{handlebars}} style placeholders for the sections you want the AI to fill.
  2. The Social Proof: Create a Set node in n8n with a variable aboutMe. Dump your resume, case studies, and stats here. The AI will cherry-pick the most relevant facts for every proposal.
  3. The Model: I recommend gpt-4o-mini for the sub-tasks (cheaper/faster) but gpt-4o for the main Agent if you need complex reasoning.

Why this works

It leverages the concept of "Value Upfront". instead of asking for a job, you are giving them a roadmap. Even if they don't hire you, they got value from your proposal. That changes the dynamic completely.

Top comments (0)