# AI-powered document workflow automation with OpenAI: n8n workflow

> Started by another system calling it, and works across Email, Google Drive, HubSpot, Salesforce and one other. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/ai-powered-document-workflow-automation-with-openai (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [CRM](https://millionrounds.com/workflows?category=CRM#library)

# AI-powered document workflow automation with OpenAI

Started by another system calling it, and works across Email, Google Drive, HubSpot, Salesforce and one other. It hands the judgement calls to OpenAI. 21 steps, 3 branches: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fai-powered-document-workflow-automation-with-openai)

**21 steps** Large: read it before trusting it with anything live

**3** Branches: places the flow splits

**0** Loops or waits

**5** Services it connects to

## The flow

Starts it 3 Model 1 Logic 7 Service 10

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

- 1 **Webhook Trigger** Webhook *Starts it*
- 2 **OCR Processing** Google Cloud Vision *Service*
- 3 **AI Content Analysis** Open Ai *Model*
- 4 **Feedback Loop** Webhook *Starts it*
- 5 **Email Trigger** Email Read Imap *Service*
- 6 **Cloud Storage Watcher** Google Drive *Service*
- 7 **Error Trigger** Error trigger *Starts it*
- 8 **File Type Detection** Function *Logic*
- 9 **Data Structuring** Function *Logic*
- 10 **Data Mapping** Function *Logic*
- 11 **Status Notifications** Slack *Service*
- 12 **Format Conversion** Switch *Logic*
- 13 **Content-Based Classification** Switch *Logic*
- 14 **Salesforce Integration** Salesforce *Service*
- 15 **HubSpot Integration** Hubspot *Service*
- 16 **Processing Analytics** Http Request *Service*
- 17 **Machine Learning Classification** Http Request *Service*
- 18 **Document Storage** Google Drive *Service*
- 19 **Automated Validation** Function *Logic*
- 20 **Human Review Routing** Switch *Logic*
- 21 **Human Review Process** Http Request *Service*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 21, with 3 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Email, Google Drive, HubSpot, Salesforce, Slack
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Email, Google Drive, HubSpot, Salesforce and Slack accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on another system calling it.

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?

Take your time. At 21 steps it is large: read it before trusting it with anything live.

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 21 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fai-powered-document-workflow-automation-with-openai)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Email](https://millionrounds.com/workflows?service=Email#library)[Google Drive](https://millionrounds.com/workflows?service=Google+Drive#library)[HubSpot](https://millionrounds.com/workflows?service=HubSpot#library)[Salesforce](https://millionrounds.com/workflows?service=Salesforce#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)

## Workflows like it

Also crm, with the same services where possible, closest in size first.

- [**Automated 4-stage email follow-up system with Groq and NocoDB** 21 steps · calls a model · Email, NocoDB](https://millionrounds.com/workflow/automated-4-stage-email-follow-up-system-with-groq-and-nocod)
- [**Capture and follow up on Tally inquiries with Salesforce** 21 steps · calls a model · Salesforce](https://millionrounds.com/workflow/capture-and-follow-up-on-tally-inquiries-with-salesforce)
- [**Assess contract risk from Google Drive with Groq** 22 steps · calls a model · Google Drive, Salesforce](https://millionrounds.com/workflow/assess-contract-risk-from-google-drive-with-groq)
- [**GPT-4o: Twilio integration with OpenAI and Airtable** 20 steps · calls a model · Airtable, Email](https://millionrounds.com/workflow/gpt-4o-twilio-integration-with-openai-and-airtable)
- [**Track competitor risk from Gmail and webhooks with Groq** 22 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/track-competitor-risk-from-gmail-and-webhooks-with-groq)
- [**Reach out to companies that recently secured funding** 20 steps · HubSpot, Slack](https://millionrounds.com/workflow/reach-out-to-companies-that-recently-secured-funding)
