How to Automate Your Side Hustle with n8n and ChatGPT
Are you juggling a side hustle while managing a busy schedule? Automation can be a game-changer, saving you time and boosting efficiency. In this beginner-friendly guide, we’ll explore how to use n8n, a powerful open-source workflow automation tool, combined with ChatGPT, to streamline tasks for your side hustle. Whether you're running an online store, managing social media, or offering freelance services, this step-by-step guide will help you automate repetitive tasks with ease.
What is n8n and ChatGPT?
n8n
n8n (pronounced "nodate") is a free, open-source automation tool that lets you connect apps and services to create automated workflows. Think of it as a digital assistant that handles repetitive tasks like sending emails, updating spreadsheets, or posting to social media all without coding skills.
ChatGPT
ChatGPT, developed by OpenAI, is an AI-powered conversational model that can generate human-like text. It’s perfect for drafting emails, creating content, or answering customer queries. By integrating ChatGPT with n8n, you can add smart automation to your side hustle.
Why Automate Your Side Hustle?
Running a side hustle often means wearing multiple hats marketer, customer support, content creator, and more. Automation with n8n and ChatGPT can:
- Save time: Automate repetitive tasks like responding to customer inquiries or scheduling posts.
- Reduce errors: Ensure consistent messaging and data handling.
- Scale your hustle: Handle more tasks without burning out.
- Enhance customer experience: Provide quick, professional responses using AI-generated text.
Prerequisites
Before we dive in, you’ll need:
- n8n Account: Sign up for a free n8n cloud account at n8n.io or install n8n locally (requires some technical setup).
- OpenAI Account: Sign up at openai.com to get an API key for ChatGPT.
- Basic Understanding: No coding skills are required, but familiarity with your side hustle’s tools (e.g., Gmail, Google Sheets, or social media platforms) is helpful.
Step-by-Step Guide: Automating Your Side Hustle
Let’s walk through a practical example: Automating customer inquiries for an online store. We’ll create a workflow that:
- Detects new customer emails.
- Uses ChatGPT to generate a personalized response.
- Sends the response back to the customer.
- Logs the interaction in a Google Sheet.
Step 1: Set Up n8n
- Sign Up or Install n8n:
- For beginners, use the n8n cloud version at n8n.io. Sign up and create a new workflow.
- If you prefer local installation, follow n8n’s installation guide.
- Create a New Workflow:
- In the n8n dashboard, click “New Workflow” and give it a name, e.g., “Customer Inquiry Automation.”
Step 2: Configure the Trigger (Gmail)
We’ll use Gmail to detect new customer inquiries.
- Add a Gmail Node:
- In the workflow editor, click the “+” button to add a node.
- Search for “Gmail” and select the “Gmail Trigger” node.
- Connect your Gmail account:
- Click on the node, then “Create New” under Credentials.
- Follow the OAuth prompts to connect your Gmail account.
- Set up the trigger:
- Choose “On new email” as the trigger event.
- Optionally, filter emails by sender or subject (e.g., “from:support@yourstore.com”).
- Save and test the node to ensure it detects new emails.
Step 3: Integrate ChatGPT for Response Generation
Next, we’ll use ChatGPT to draft a response to the customer.
- Add an HTTP Request Node:
- Click “+” to add a new node and select “HTTP Request.”
- Set the URL to https://api.openai.com/v1/chat/completions.
- Set the Method to POST.
- Add OpenAI API Key:
- In the “Headers” section, add:
- Key: Authorization
- Value: Bearer YOUR_OPENAI_API_KEY (replace with your actual API key from OpenAI).
- Configure the Request Body:
- In the “Body Parameters” section, add a JSON payload like this:
{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "system",
"content": "You are a friendly customer support assistant for an online store. Draft a professional, concise response to customer inquiries."
},
{
"role": "user",
"content": "Respond to this customer email: {{$node['Gmail'].json['text']}}"
}
],
"max_tokens": 150
}
- This tells ChatGPT to generate a response based on the email content from the Gmail node.
- Test the node to ensure ChatGPT generates a response.
Step 4: Send the Response Back
Now, we’ll send the AI-generated response to the customer.
- Add another Gmail Node:
- Select “Gmail” and choose the “Send Email” operation.
- Connect it to the same Gmail account.
- Configure the email:
- Set “To” to {{$node['Gmail'].json['from']}} (the customer’s email).
- Set “Subject” to Re: {{$node['Gmail'].json['subject']}}.
- Set “Message” to {{$node['HTTP Request'].json['choices'][0]['message']['content']}} (ChatGPT’s response).
- Test the node to confirm the email is sent.
Step 5: Log to Google Sheets
To keep track of inquiries, we’ll log them in a Google Sheet.
- Add a Google Sheets Node:
- Click “+” and select “Google Sheets.”
- Connect your Google account via OAuth.
- Configure the node:
- Select your spreadsheet and worksheet.
- Map fields like:
- Customer Email: {{$node['Gmail'].json['from']}}
- Inquiry: {{$node['Gmail'].json['text']}}
- Response: {{$node['HTTP Request'].json['choices'][0]['message']['content']}}
- Timestamp: {{new Date().toISOString()}}
- Test the node to ensure data is logged.
Step 6: Activate the Workflow
- Click “Activate” in the n8n editor to enable the workflow.
- Send a test email to your Gmail account to verify the automation works end-to-end.
Example Workflow JSON
For reference, here’s the n8n workflow JSON you can import into n8n:
{
"nodes": [
{
"parameters": {
"trigger": "onNewEmail",
"authentication": "oAuth2",
"options": {}
},
"name": "Gmail Trigger",
"type": "n8n-nodes-base.gmailTrigger",
"typeVersion": 1,
"position": [240, 300],
"credentials": {
"gmailOAuth2": "Your Gmail Credentials"
}
},
{
"parameters": {
"method": "POST",
"url": "https://api.openai.com/v1/chat/completions",
"sendHeaders": true,
"headers": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer YOUR_OPENAI_API_KEY"
}
]
},
"sendBody": true,
"body": {
"parameters": [
{
"name": "model",
"value": "gpt-3.5-turbo"
},
{
"name": "messages",
"value": [
{
"role": "system",
"content": "You are a friendly customer support assistant for an online store."
},
{
"role": "user",
"content": "Respond to this customer email: {{$node['Gmail Trigger'].json['text']}}"
}
]
},
{
"name": "max_tokens",
"value": 150
}
]
}
},
"name": "ChatGPT",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [460, 300]
},
{
"parameters": {
"operation": "send",
"to": "={{$node['Gmail Trigger'].json['from']}}",
"subject": "Re: {{$node['Gmail Trigger'].json['subject']}}",
"message": "={{$node['ChatGPT'].json['choices'][0]['message']['content']}}",
"authentication": "oAuth2"
},
"name": "Send Response",
"type": "n8n-nodes-base.gmail",
"typeVersion": 1,
"position": [680, 300],
"credentials": {
"gmailOAuth2": "Your Gmail Credentials"
}
},
{
"parameters": {
"operation": "append",
"sheetId": "YOUR_SHEET_ID",
"range": "Sheet1",
"values": {
"email": "={{$node['Gmail Trigger'].json['from']}}",
"inquiry": "={{$node['Gmail Trigger'].json['text']}}",
"response": "={{$node['ChatGPT'].json['choices'][0]['message']['content']}}",
"timestamp": "={{new Date().toISOString()}}"
},
"authentication": "oAuth2"
},
"name": "Log to Sheets",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 1,
"position": [900, 300],
"credentials": {
"googleSheetsOAuth2": "Your Google Sheets Credentials"
}
}
],
"connections": {
"Gmail Trigger": {
"main": [
[
{
"node": "ChatGPT",
"type": "main",
"index": 0
}
]
]
},
"ChatGPT": {
"main": [
[
{
"node": "Send Response",
"type": "main",
"index": 0
},
{
"node": "Log to Sheets",
"type": "main",
"index": 0
}
]
]
}
}
}
To use this:
- Copy the JSON.
- In n8n, click “Import Workflow” and paste the JSON.
- Replace YOUR_OPENAI_API_KEY and credentials with your own.
Other Automation Ideas for Your Side Hustle
- Social Media Posting: Use n8n to schedule posts to Twitter or LinkedIn, with ChatGPT generating engaging captions.
- Order Notifications: Automate order confirmations by connecting your e-commerce platform (e.g., Shopify) to n8n and sending custom emails.
- Content Creation: Use ChatGPT to draft blog posts or product descriptions, then push them to your CMS (e.g., WordPress) via n8n.
Tips for Success
- Test Thoroughly: Always test your workflow with dummy data to avoid errors.
- Monitor Usage: OpenAI’s API has costs based on usage, so keep an eye on your token consumption.
- Start Simple: Begin with one automation (like the example above) before building complex workflows.
- Explore n8n’s Nodes: n8n supports hundreds of apps check the n8n integrations page for inspiration.
Conclusion
Automating your side hustle with n8n and ChatGPT is like hiring a virtual assistant that works 24/7. By connecting your tools and leveraging AI, you can focus on growing your business instead of getting bogged down by repetitive tasks. Start small, experiment with workflows, and watch your side hustle thrive!
If you need help setting up specific automations or want to dive deeper, leave a comment below or check out the n8n community and OpenAI documentation.
Happy automating!