LLM Prompts

n8n Workflow Debugging Assistant

Helps debug n8n workflows by analyzing JSON and error messages.

The method

Use this prompt in a chat interface with an LLM like ChatGPT. Paste the n8n workflow JSON and error messages. Describe the desired outcome. Ideal for troubleshooting complex automation flows. Focus on specific nodes and data transformations.

The prompts

Prompt 1
Analyze the following n8n workflow JSON and error message to identify the root cause of the failure. The goal is to successfully send data from a Google Sheet to a PostgreSQL database.

Workflow JSON:
```json
{
"nodes": [
{
"parameters": {
"spreadsheetId": "YOUR_SPREADSHEET_ID",
"range": "Sheet1!A1:B10",
"options": {}
},
"name": "Google Sheets",
"type": "n8n-nodes-google-sheets.googleSheets",
"typeVersion": 1,
"position": [100, 200]
},
{
"parameters": {
"operation": "insert",
"table": "users",
"options": {}
},
"name": "PostgreSQL",
"type": "n8n-nodes-postgres.postgres",
"typeVersion": 1,
"position": [300, 200]
}
],
"connections": {
"Google Sheets": {
"main": [
[
{
"node": "PostgreSQL",
"type": "main",
"index": 0
}
]
]
}
}
}
```

Error Message:
```
ERROR: column "name" does not exist
Query: INSERT INTO users (value1, value2) VALUES ($1, $2)
```

Provide a detailed explanation of the error and suggest specific changes to the workflow to resolve it. Consider the data types and column names in both the Google Sheet and the PostgreSQL table. The Google Sheet has columns 'Name' and 'Email'.
Prompt 2
I'm building an n8n workflow that should pull data from a REST API, transform it, and then send it to Slack. However, I am encountering issues with the data transformation. The API returns a JSON structure with nested objects, and I need to extract specific values from those nested objects and format them into a human-readable message for Slack. The current transformation results in an empty message being sent to Slack.

Here is the relevant part of the n8n workflow JSON:
```json
{
"nodes": [
{
"parameters": {
"url": "https://api.example.com/data",
"options": {}
},
"name": "HTTP Request",
"type": "n8n-nodes-http.httpRequest",
"typeVersion": 1,
"position": [100, 200]
},
{
"parameters": {
"jsCode": "let items = $input.all();nnreturn items.map(item => {n const data = item.json.data;n const formattedMessage = `New data: Name: ${data.name}, Value: ${data.value}`n return {json: {text: formattedMessage}} ;n});",
"options": {}
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [300, 200]
},
{
"parameters": {
"channel": "#general",
"text": "={{$json.text}}",
"options": {}
},
"name": "Slack",
"type": "n8n-nodes-slack.slack",
"typeVersion": 1,
"position": [500, 200]
}
],
"connections": {
"HTTP Request": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
},
"Function": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
}
}
}
```

Example of the JSON data returned by the API:
```json
{
"data": {
"name": "Example Name",
"value": 123
}
}
```

Provide detailed steps and code snippets to correctly extract the data and format the message for Slack.