Skip to main content

Ted Europa Agentic AI Workflow

1. Purpose

This workflow automates the process of finding procurement opportunities related to accessibility compliance, identifying potential buyers, generating personalized email content using AI, and sending outreach emails. It scrapes procurement data based on accessibility keywords, enriches it with buyer information, and sends targeted marketing emails to procurement officers.

2. Trigger

Type: Cron (Scheduled)

Details:

The workflow runs automatically on a daily schedule.

Schedule Time: 23:50 (11:50 PM) daily

The workflow is triggered by a Schedule Trigger node that runs at the specified time each day, ensuring consistent daily execution for procurement opportunity discovery and outreach.

3. Step-by-Step Process

Step 1: Schedule Trigger

What happens here: The workflow starts automatically at 23:50 (11:50 PM) every day.

What input it uses: No input required - this is the entry point of the workflow.

Why this step is needed: Ensures the workflow runs consistently on a daily schedule without manual intervention, allowing for automated procurement opportunity discovery.

Step 2: KEYWORDS

What happens here: Sets up an array of accessibility-related keywords that will be used to search for procurement opportunities.

What input it uses: Hardcoded keywords array: ["EN 301 549", "accessibility", "WCAG", "digital accessibility", "web accessibility"]

Why this step is needed: Defines the search terms that will be used to find relevant procurement opportunities in the European market. These keywords target accessibility compliance requirements.

Step 3: Transform Keywords to Items

What happens here: Transforms the keywords array into individual items, where each keyword becomes a separate workflow item that can be processed independently.

What input it uses: The keywords array from the previous step.

What output it produces: Individual items, each containing one keyword and its index position.

Why this step is needed: Allows the workflow to process each keyword separately, enabling parallel or sequential scraping for each search term.

Step 4: Loop Over Items

What happens here: Iterates through each keyword item one at a time, ensuring each keyword is processed before moving to the next.

What input it uses: Individual keyword items from the previous step.

Why this step is needed: Controls the flow to process keywords sequentially, preventing overload and ensuring each keyword gets proper attention during the scraping process.

Step 5: SCRAPER

What happens here: Calls the scraping service to search for procurement opportunities based on the current keyword. The scraper searches for relevant procurement records and uploads results to S3.

What input it uses:

  • Keyword from the current loop iteration
  • Keyword index
  • Limit: 10 results per keyword
  • Upload to S3: enabled

What output it produces: Scraped procurement data including organization names, buyer information, CPV codes, locations, and links, stored in S3 with an S3 URI.

Why this step is needed: Discovers procurement opportunities by searching public procurement databases for accessibility-related tenders and contracts.

API Endpoint: https://agents.fsgarage.in/scrape

Method: POST

Step 6: If

What happens here: Checks whether the scraping operation was successful by verifying if an S3 URI exists in the response.

What input it uses: The S3 URI from the scraper response.

What output it produces:

  • True path: Continues to data update if S3 URI exists
  • False path: Stops processing if no data was scraped

Why this step is needed: Ensures only successful scraping operations proceed to the next steps, preventing errors from processing empty or failed scraping attempts.

Step 7: AGENT- Update_data

What happens here: Updates the system database with the newly scraped procurement data, including status, S3 URI, rows count, timestamp, and organization details.

What input it uses:

  • Status of the scraping operation
  • S3 URI where data is stored
  • Number of rows scraped
  • Timestamp
  • Full data array
  • Domain name and organization name from the first record

What output it produces: Confirmation that data has been stored in the system.

Why this step is needed: Persists the scraped procurement data in the system for future reference and ensures data is available for subsequent processing steps.

API Endpoint: https://agents.fsgarage.in/update_data

Method: POST

Step 8: Agent-query

What happens here: Queries the AI agent to retrieve accessibility records and related information that will be used for email personalization.

What input it uses:

  • Query: "accessibility records"
  • Format: JSON
  • Top K: 3 (retrieves top 3 relevant records)

What output it produces: Relevant accessibility records and context from the knowledge base.

Why this step is needed: Provides context and information that will be used to personalize the email content, making outreach more relevant and effective.

API Endpoint: https://agents.fsgarage.in/agent

Method: POST

Step 9: Prepare Apollo.io Search Requests

What happens here: Transforms the procurement data into the format required for the Apollo.io API call. Creates individual items for each organization, preparing them for people search.

What input it uses: The data array from the agent query response.

What output it produces: Individual items with organization name, page number (1), and per_page count (5) for Apollo.io search.

Why this step is needed: Prepares the data structure needed to search for contact information (people) associated with each organization in the procurement records.

Step 10: HTTP Request2 (Apollo.io)

What happens here: Searches Apollo.io's database to find people and contact information associated with each organization from the procurement data.

What input it uses:

  • Organization name
  • Page: 1
  • Per page: 5 results

What output it produces: Contact information including email addresses, names, and titles of people associated with the organizations.

Why this step is needed: Enriches the procurement data with actual contact information (emails, names) that will be used for email outreach.

API Endpoint: https://api.apollo.io/v1/people/search

Method: POST

Authentication: API Key (x-api-key header)

Step 11: Transform Procurement Data for Email

What happens here: Transforms the procurement data into the format required for email generation. Extracts buyer information, organization details, and formats them for the email generation service.

What input it uses: The procurement data array from the agent query.

What output it produces: Formatted data with buyer email, buyer name, buyer title, organization name, CPV code, buyer location, link, and language (English).

Why this step is needed: Structures the data in the exact format expected by the email generation service, ensuring all necessary information is available for creating personalized emails.

Step 12: HTTP Request4 (Generate Email)

What happens here: Calls the AI email generation service to create personalized email content for each buyer based on their procurement opportunity and organization details.

What input it uses: All items from the previous step, containing buyer and organization information.

What output it produces: Generated email content including subject lines and email body text in markdown format.

Why this step is needed: Leverages AI to create personalized, relevant email content that speaks to each buyer's specific procurement needs and organization context.

API Endpoint: https://agents.fsgarage.in/generate-email

Method: POST

Step 13: Convert Markdown to HTML and Format Email

What happens here: Transforms the generated email content from markdown to HTML format, extracts the subject line, and structures the email data for the email sending service.

What input it uses: The generated email content from the previous step, including subject lines and email bodies.

What output it produces: Formatted email objects with sender information (Wally, support@wallyax.com), recipient details, HTML content, and plain text content.

Why this step is needed: Converts markdown formatting to HTML for proper email rendering and structures the data in the format required by the Brevo email service.

Step 14: Validate and Structure Email Data

What happens here: Final formatting step that ensures the sender information is properly structured as an object (not a string) and validates all required email fields are present.

What input it uses: Email objects from the previous step.

What output it produces: Fully formatted email objects with validated sender, recipient, subject, HTML, and text content.

Why this step is needed: Ensures data integrity and proper formatting before sending emails, preventing errors in the email sending service.

Step 15: Brevo-email

What happens here: Sends the generated emails via the Brevo (formerly Sendinblue) email service to the procurement officers identified in the workflow.

What input it uses: Fully formatted email objects with all required fields (sender, recipient, subject, HTML content, text content).

What output it produces: Email delivery confirmation and status from Brevo.

Why this step is needed: Delivers the personalized outreach emails to potential buyers, completing the marketing automation process.

API Endpoint: https://api.brevo.com/v3/smtp/email

Method: POST

Authentication: API Key (api-key header)

4. Workflow Logic Summary

The workflow executes the following sequence from start to finish:

  1. Triggers automatically at 23:50 daily via schedule trigger
  2. Sets up keywords for accessibility-related procurement searches
  3. Splits keywords into individual items for processing
  4. Loops through each keyword sequentially
  5. Scrapes procurement data for each keyword and stores in S3
  6. Validates that scraping was successful (S3 URI exists)
  7. Updates system database with scraped procurement records
  8. Queries AI agent for accessibility context and records
  9. Splits into two parallel paths:
    • Path A: Searches Apollo.io for contact information
    • Path B: Generates personalized emails using AI
  10. Formats email content from markdown to HTML
  11. Validates and structures email data
  12. Sends emails via Brevo to identified procurement officers

This automated process ensures consistent daily discovery of accessibility-related procurement opportunities and automated outreach to potential buyers.

5. Diagram / Screenshot

Ted Europa Agentic AI Workflow Diagram

The workflow diagram shows the complete automation flow from the schedule trigger through keyword processing, data scraping, AI agent queries, and parallel email generation and contact enrichment processes.

6. Dependencies

This workflow depends on several backend services, external APIs, and third-party services to function properly.

Backend Server APIs

The workflow uses multiple backend services hosted at agents.fsgarage.in:

Scraping Service

  • Endpoint: https://agents.fsgarage.in/scrape
  • Method: POST
  • Purpose: Scrapes procurement data based on keywords from public procurement databases
  • Requires Auth: No (internal service)
  • Note: This is our own service. It uses ScrapingBee internally for web scraping operations, but we are not directly using ScrapingBee in this workflow.

Data Update Service

  • Endpoint: https://agents.fsgarage.in/update_data
  • Method: POST
  • Purpose: Updates system database with scraped procurement data
  • Requires Auth: No (internal service)

AI Agent Service

  • Endpoint: https://agents.fsgarage.in/agent
  • Method: POST
  • Purpose: Queries AI agent for accessibility records and context from knowledge base
  • Requires Auth: No (internal service)

Email Generation Service

  • Endpoint: https://agents.fsgarage.in/generate-email
  • Method: POST
  • Purpose: Generates personalized email content using AI based on procurement data
  • Requires Auth: No (internal service)

External APIs

Apollo.io API

  • Endpoint: https://api.apollo.io/v1/people/search
  • Method: POST
  • Purpose: Searches for people and contact information by organization name
  • Requires Auth: Yes (API Key in x-api-key header)
  • API Key: Stored in n8n credentials
  • Usage: Enriches procurement data with buyer contact information

Brevo Email API

  • Endpoint: https://api.brevo.com/v3/smtp/email
  • Method: POST
  • Purpose: Sends transactional emails to recipients
  • Requires Auth: Yes (API Key in api-key header)
  • API Key: Stored in n8n credentials
  • Usage: Delivers generated marketing emails to procurement officers

Third-Party Services

Amazon S3

  • Purpose: Cloud storage for scraped procurement data
  • Usage: Stores scraped procurement data files uploaded by the scraping service
  • Configuration: Data uploaded automatically by scraping service
  • Access: Managed by backend services

Note: ScrapingBee is not directly used in this workflow. The scraping service at https://agents.fsgarage.in/scrape is our own service that handles web scraping operations internally.

n8n Instance

Workflow URL: https://agent.fsgarage.in/workflow/a55ELNHarCGiNpWE

Workflow Name: Agentic AI Marketing

Workflow ID: a55ELNHarCGiNpWE

Email: technology@fleetstudio.com

Password:

n8n Instance URL: https://agent.fsgarage.in

GitHub Repository

Repository: https://github.com/TeamFleetStudio/Agentic-AI-POC

Description: Source code repository for the Agentic AI POC project, including backend services and workflow implementations.