I’ve installed this node and can’t get it to function as I think it is intended. I’m very new to n8n, so could be I’m doing something wrong.
I want to get all active projects from Harvest, parse them for new projects, and create respective new cards in Trello and send a messages to a Slack channel.
I’ve gotten the Trello card creation and Slack message to work, but the issue is that it is repeating the projects already created.
- Creating project 1 = project 1 trello card and slack notification (like it should).
- Creating project 2 = project 1 AND project 2 trello card and slack notification (duplicates project 1)
- Creating project 3 = project 1 AND project 2 AND project 3 (duplicates project 1 and 2)
etc.
I thought the whole point of this node was to “know” that i.e “project 1” already was parsed, but it seems like it takes the complete json output and registers it as new if there is a new project.
I hope this makes sense.
A workaround is to limit the output from the Harvest node to 1
. This is mostly fine since I’m polling the Harvest API every 20
seconds and we don’t create that many projects. But if multiple projects are created within the 20-second interval (that happens sometimes), only one will be “approved”.
Here is my workflow (I’ve removed pretty much everything of my custom data that is not relevant.):
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
120,
120
]
},
{
"parameters": {
"resource": "project",
"accountId": <removed>,
"limit": 100,
"filters": {
"is_active": true,
"updated_since": "2022-05-18T09:01:00.000Z"
}
},
"name": "Harvest",
"type": "n8n-nodes-base.harvest",
"typeVersion": 1,
"position": [
420,
300
],
"credentials": {
"harvestApi": {
"id": "1",
"name": "Harvest account"
}
}
},
{
"parameters": {
"interval": 30
},
"name": "Interval",
"type": "n8n-nodes-base.interval",
"typeVersion": 1,
"position": [
120,
300
]
},
{
"parameters": {
"listId": "=<removed>",
"name": "=<removed>",
"description": "<removed>",
"additionalFields": {
"pos": "=top"
}
},
"name": "Trello",
"type": "n8n-nodes-base.trello",
"typeVersion": 1,
"position": [
1000,
200
],
"credentials": {
"trelloApi": {
"id": "3",
"name": "Trello account"
}
}
},
{
"parameters": {
"channel": "<removed>",
"text": "<removed>,
"jsonParameters": "=",
"otherOptions": {
"icon_url": "<removed>",
"sendAsUser": "<removed>"
},
"attachments": []
},
"name": "Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 1,
"position": [
1000,
380
],
"credentials": {
"slackApi": {
"id": "2",
"name": "<removed>"
}
}
},
{
"parameters": {
"defaultValue": "=true"
},
"name": "hasChanged",
"type": "CUSTOM.hasChanged",
"typeVersion": 1,
"position": [
680,
300
]
},
{
"parameters": {},
"name": "NoOp",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
1000,
560
]
}
],
"connections": {
"Harvest": {
"main": [
[
{
"node": "hasChanged",
"type": "main",
"index": 0
}
]
]
},
"Interval": {
"main": [
[
{
"node": "Harvest",
"type": "main",
"index": 0
}
]
]
},
"hasChanged": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
},
{
"node": "Trello",
"type": "main",
"index": 0
}
],
[
{
"node": "NoOp",
"type": "main",
"index": 0
}
]
]
}
}
}
JSON output from the Harvest node:
[{
"id": 32913606,
"name": "Project 1",
"code": "1234",
"is_active": true,
"is_billable": true,
"is_fixed_fee": false,
"bill_by": "Project",
"budget": null,
"budget_by": "none",
"budget_is_monthly": false,
"notify_when_over_budget": false,
"over_budget_notification_percentage": 80,
"show_budget_to_all": false,
"created_at": "2022-05-18T10:16:26Z",
"updated_at": "2022-05-18T10:16:26Z",
"starts_on": null,
"ends_on": null,
"over_budget_notification_date": null,
"notes": "",
"cost_budget": null,
"cost_budget_include_expenses": false,
"hourly_rate": 1200,
"fee": null,
"client": {
"id": 8090079,
"name": "Test",
"currency": "NOK"
}
},
{
"id": 32913382,
"name": "Project 2",
"code": "2345",
"is_active": true,
"is_billable": true,
"is_fixed_fee": false,
"bill_by": "Project",
"budget": null,
"budget_by": "none",
"budget_is_monthly": false,
"notify_when_over_budget": false,
"over_budget_notification_percentage": 80,
"show_budget_to_all": false,
"created_at": "2022-05-18T09:47:54Z",
"updated_at": "2022-05-18T09:47:54Z",
"starts_on": null,
"ends_on": null,
"over_budget_notification_date": null,
"notes": "",
"cost_budget": null,
"cost_budget_include_expenses": false,
"hourly_rate": 1200,
"fee": null,
"client": {
"id": 2324327,
"name": "Test",
"currency": "NOK"
}
}
]
Thanks!