Skip to content

Instantly share code, notes, and snippets.

@clouedoc
Created August 10, 2023 05:04
Show Gist options
  • Save clouedoc/6c2a3185213a9701c9ca144df0019107 to your computer and use it in GitHub Desktop.
Save clouedoc/6c2a3185213a9701c9ca144df0019107 to your computer and use it in GitHub Desktop.
{
"name": "automatic beeminder stepdown",
"nodes": [
{
"parameters": {},
"id": "d0116cdf-4ebc-4504-a5dd-dd0cae706ca7",
"name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
600,
400
]
},
{
"parameters": {
"url": "https://www.beeminder.com/api/v1/users/clouedoc/goals.json",
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth",
"options": {}
},
"id": "65474352-74bb-4fac-8d40-b53042722475",
"name": "BEE - get goals",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [
840,
400
],
"credentials": {
"httpQueryAuth": {
"id": "8",
"name": "Beeminder Query Auth"
}
}
},
{
"parameters": {
"conditions": {
"number": [
{
"value1": "={{ $json.contract.amount }}",
"operation": "larger",
"value2": 5
}
],
"string": [
{
"value1": "={{ JSON.stringify($json.contract.stepdown_at) }}",
"value2": "null"
}
]
}
},
"id": "10f971b6-dc4b-4a65-9ac9-8b475290f29f",
"name": "> 5$ and no stepdown planed",
"type": "n8n-nodes-base.filter",
"typeVersion": 1,
"position": [
1040,
400
]
},
{
"parameters": {
"method": "POST",
"url": "=https://www.beeminder.com/api/v1/users/clouedoc/goals/{{ $json.slug }}/stepdown.json",
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth",
"options": {}
},
"id": "39f50140-83a6-44e5-962b-5528d9a0e86e",
"name": "BEE - stepdown",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [
1300,
400
],
"credentials": {
"httpQueryAuth": {
"id": "8",
"name": "Beeminder Query Auth"
}
}
},
{
"parameters": {
"rule": {
"interval": [
{
"field": "hours",
"hoursInterval": 4
}
]
}
},
"id": "68c37cf7-c3c3-4311-a862-e576398c819e",
"name": "Every 4 hours",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1,
"position": [
600,
600
]
}
],
"pinData": {},
"connections": {
"When clicking \"Execute Workflow\"": {
"main": [
[
{
"node": "BEE - get goals",
"type": "main",
"index": 0
}
]
]
},
"BEE - get goals": {
"main": [
[
{
"node": "> 5$ and no stepdown planed",
"type": "main",
"index": 0
}
]
]
},
"> 5$ and no stepdown planed": {
"main": [
[
{
"node": "BEE - stepdown",
"type": "main",
"index": 0
}
]
]
},
"Every 4 hours": {
"main": [
[
{
"node": "BEE - get goals",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {},
"versionId": "52b9d252-a40a-4c0e-a765-2c635df936cc",
"id": "11",
"meta": {
"instanceId": "bc2abbdd0b4fc718311b1c7faa0de84c15584c8446a58732913b965301790b67"
},
"tags": [
{
"createdAt": "2023-08-10T04:53:58.717Z",
"updatedAt": "2023-08-10T04:53:58.717Z",
"id": "4",
"name": "perso"
},
{
"createdAt": "2023-08-10T04:54:00.653Z",
"updatedAt": "2023-08-10T04:54:00.653Z",
"id": "5",
"name": "beeminder"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment