n8n
Workflow
Use Regex To Select Date
This n8n workflow automates tasks and integrates with various services. Use Regex To Select Date - ready to import and run in your n8n instance.
n8n
workflow.json
About This Script
This n8n workflow automates tasks and integrates with various services. Use Regex To Select Date - ready to import and run in your n8n instance.
Features:
- Conditional logic and branching
Source Code
{
"nodes": [
{
"name": "On clicking 'execute'",
"type": "n8n-nodes-base.manualTrigger",
"position": [
250,
300
],
"parameters": [],
"typeVersion": 1,
"id": "3c21a4f1-836e-4df6-a19b-2adc12ea7375"
},
{
"name": "Check for Close Date",
"type": "n8n-nodes-base.if",
"position": [
660,
300
],
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$json[\"Close Date\"]}}",
"value2": "/\\d\\d\\d\\d-\\d\\d-\\d\\d/i",
"operation": "regex"
}
]
},
"combineOperation": "any"
},
"typeVersion": 1,
"id": "1b7d2f1f-bd6a-472f-a7fd-b633fca6bee5"
},
{
"name": "Set Close Date 3 Weeks Later",
"type": "n8n-nodes-base.set",
"position": [
910,
370
],
"parameters": {
"values": {
"string": [
{
"name": "Close Date",
"value": "={{new Date(new Date().setDate(new Date().getDate() + 21)).toISOString()}}"
}
]
},
"options": [],
"keepOnlySet": true
},
"typeVersion": 1,
"id": "5bc53e72-43c8-40af-8385-476a9d09e07c"
},
{
"name": "NoOp",
"type": "n8n-nodes-base.noOp",
"position": [
1140,
280
],
"parameters": [],
"typeVersion": 1,
"id": "654e36ae-6ec3-4aca-a98c-fb1847c3b4e9"
},
{
"name": "Set Close Date",
"type": "n8n-nodes-base.set",
"position": [
450,
300
],
"parameters": {
"values": {
"string": [
{
"name": "Close Date",
"value": "2021-11-29T00:00:00.000Z"
}
]
},
"options": []
},
"typeVersion": 1,
"id": "5df0a03e-d0fa-42fa-ad0b-73d67b2b55ea"
},
{
"name": "Set Close Date To Original",
"type": "n8n-nodes-base.set",
"position": [
910,
210
],
"parameters": {
"values": {
"string": [
{
"name": "Close Date",
"value": "={{$node[\"Set Close Date\"].json[\"Close Date\"]}}"
}
]
},
"options": [],
"keepOnlySet": true
},
"typeVersion": 1,
"id": "d984fe07-8e12-42cd-b8e0-6fb679dc6579"
}
],
"connections": {
"Set Close Date": {
"main": [
[
{
"node": "Check for Close Date",
"type": "main",
"index": 0
}
]
]
},
"Check for Close Date": {
"main": [
[
{
"node": "Set Close Date To Original",
"type": "main",
"index": 0
}
],
[
{
"node": "Set Close Date 3 Weeks Later",
"type": "main",
"index": 0
}
]
]
},
"On clicking 'execute'": {
"main": [
[
{
"node": "Set Close Date",
"type": "main",
"index": 0
}
]
]
},
"Set Close Date To Original": {
"main": [
[
{
"node": "NoOp",
"type": "main",
"index": 0
}
]
]
},
"Set Close Date 3 Weeks Later": {
"main": [
[
{
"node": "NoOp",
"type": "main",
"index": 0
}
]
]
}
},
"n8n_version": "1.5.0"
}
Requirements
n8n instance, API credentials for connected services
Tags
#n8n
#automation
#workflow