⏳ Inactivity & Threshold Check
Configured with Chat Trigger, Execute Workflow Trigger, Information Extractor, OpenAI Chat Model, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Trigger
- Routing
- AI & models
- Code
- Data store
- Transform
- Wait
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| When clicking ‘Test workflow’ | Trigger | Manual Trigger | See node parameters |
| No Operation, do nothing1 | Routing | No Op | See node parameters |
| Information Extractor | AI & models | Information Extractor | See node parameters |
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| get wait seconds | Code | Code | See node parameters |
| Set last_seen | Data store | Redis | set |
| Get waiting_reply | Data store | Redis | get |
| Mod input | Transform | Edit Fields | See node parameters |
| waiting_reply? | Routing | If | See node parameters |
| When chat message received | Trigger | Chat Trigger | See node parameters |
| Set waiting_reply | Data store | Redis | set |
| Get buffer | Data store | Redis | get |
| Delete buffer_in | Data store | Redis | delete |
| Delete waiting_reply | Data store | Redis | delete |
| WaitSeconds | Wait | Wait | See node parameters |
| Buffer messages | Data store | Redis | push |
| Set buffer_count increment | Data store | Redis | incr |
| Get last_seen | Data store | Redis | get |
| Get buffer_count | Data store | Redis | get |
| Map ouput | Transform | Edit Fields | See node parameters |
| Check Inactivity + Count | Routing | If | See node parameters |
| Delete waiting_reply1 | Data store | Redis | delete |
| No Operation, do nothing2 | Routing | No Op | See node parameters |
| Wait | Wait | Wait | See node parameters |
| When Executed by Another Workflow | Trigger | Execute Workflow Trigger | See node parameters |
| Mock input data | Transform | Edit Fields | See node parameters |
| No Operation, do nothing3 | Routing | No Op | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
openAiApiredis
Workflow notes
🧹 Buffer Cleanup
🧹 Buffer Cleanup
After consolidation and reply:
-
DELETE keys:
buffer_in:{{context_id}}buffer_count:{{context_id}}waiting_reply:{{context_id}}
📥 Input Buffer
📥 Input Buffer
-
Save incoming message
- Push the new message into Redis list
buffer_in:{{context_id}}.
- Push the new message into Redis list
-
Update metadata
- Set
last_seen:{{context_id}}to the current timestamp (with a TTL ofwaitSeconds + 60). - INCR the counter key
buffer_count:{{context_id}}(also expiring afterwaitSeconds + 60).
- Set
-
Check “waiting” flag
- GET
waiting_reply:{{context_id}}. - If it’s null (no batch in flight), SET it to
truewith TTLwaitSecondsto block concurrent triggers.
- GET
⏳ Inactivity & Threshold Check
⏳ Inactivity & Threshold Check
-
Fetch state
- GET
last_seen:{{context_id}}(when the last message arrived) - GET
buffer_count:{{context_id}}(how many messages are queued)
- GET
-
Evaluate trigger
- Inactivity:
(now – last_seen) ≥ waitSeconds * 1000 - Or threshold:
buffer_count ≥ 1(or your desired batch size)
- Inactivity:
-
Branch
- True: proceed to “Get buffer” and consolidate.
- False: exit (noOp) and let the waiting‐node/flag mechanism retry later.
⏳ Inactivity & Threshold Check
⏳ Inactivity & Threshold Check
Purpose and structure
This folder contains the ⏳ Inactivity & Threshold Check workflow. Its executable nodes use chatTrigger, code, executeWorkflowTrigger, if, informationExtractor, lmChatOpenAi, manualTrigger, noOp, redis, set, wait. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
When clicking ‘Test workflow’, When chat message received, When Executed by Another Workflow
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Wait/0903_Wait_Redis_Automate_Triggered.json MIT; preserve source notices.