Skip to content

Trigger: Chat (chat_trigger)

This trigger starts an automation when a user sends a message through a web chat interface generated by the node. When configured, the system generates a unique URL that can be shared with operators, guards, or other users so they can interact with the automation flow in real time through a conversation.

When to use it?

  • When you want to create a conversational assistant for operators to check the status of sensors, cameras, or alarms without navigating the dashboard.
  • When you need an attendance bot for the security center that answers frequently asked questions or guides staff through emergency procedures.
  • When you want guards to report incidents by typing in a simple interface from their phone or PC, triggering a logging or notification flow.
  • When you need a conversational query interface connected to an AI model to analyze events, logs, or system states.
  • When you want to create a bidirectional communication channel between an operator and an automated flow (e.g.: confirm an alarm, request a report).

If you need to trigger an automation from an external system via HTTP, use Trigger: Webhook.
If you need to react to system events (sensors, state changes), use Trigger: Event or Trigger: State Change.


How to configure it

Step 0) Open the parameters

  • In the automations canvas, double-click the Chat node.
  • A modal opens with two tabs: Form and JSON Editor. Stay on Form.

Step 1) Get the Chat URL

When you open the form, you'll see the Chat URL field with the web address automatically generated for this node.

https://your-instance.netsocs.com/chat/{node-id}
  • This URL is unique per node. Each Chat node has its own URL.
  • Click the URL or the copy icon to copy it to the clipboard.
  • The URL opens directly in a new tab so you can test it.
  • Share this URL with the users (operators, guards, supervisors) who will use the chat.

There is nothing to configure in this field — it is informational and generated automatically.


Step 2) Configure chat history

History allows subsequent nodes in the flow (especially AI models) to have context of the conversation, not just the last message sent.

Include History

State Behavior
Enabled (default) The flow receives the current message plus previous messages from the conversation
Disabled The flow receives only the most recent message, without prior context
  • Enable it if the flow connects to an AI agent that needs to understand the context of the conversation.
  • Disable it if you only need to process individual messages without needing context.

History Count

  • Defines how many previous messages are included in the history sent to the flow.
  • Default value: 20
  • Valid range: 1 to 100
  • Higher values provide more context but increase the size of the processed payload.
Use case Recommended value
Simple quick-query chat 5 – 10
Conversational assistant with context 20 – 30
Long conversation analysis 50 – 100

Step 3) (Optional) Active sessions

If there are ongoing chat sessions linked to this node, they will appear listed as tags below the form. Each tag shows the session ID and can be individually closed to unlink it.

In most cases it is not necessary to manage this manually — sessions are created automatically when a user opens the Chat URL.


Best practices

  • Always combine with an AI agent node (such as Agent Model): the Chat trigger alone receives the message; the real value comes from connecting it to a model that processes and responds.
  • Use a history of 10-20 messages for most operational assistance cases. Very high values can slow down processing if the AI model charges per token.
  • Don't share the Chat URL publicly unless intentional — anyone with the URL can send messages and trigger the flow.
  • Test the URL before distributing it: open it in a new tab and send a test message to verify the flow responds correctly.
  • Use "Include History = No" if the flow executes discrete operations (e.g.: log an event, check the status of a specific sensor) where previous context doesn't matter.
  • One per function: if you have different uses (alarm assistant, access assistant), create a separate Chat node for each to keep URLs and flows independent.

Troubleshooting (common issues)

  • The chat doesn't respond when I send a message
  • Verify that the automation is active and published.
  • Check that the nodes after the Chat trigger are correctly configured (especially the agent or action node that generates the response).
  • Verify that the URL you are using corresponds to the correct node of the active automation.

  • I don't see the Chat URL in the form

  • The URL is generated from the node's internal ID. If the node was just created and the automation was not saved, it may not be available yet. Save the flow and reopen the node.

  • The conversation history is not maintained between sessions

  • History is per chat session. If the user opens a new tab or a new session URL, a new conversation starts.
  • Verify that "Include History" is enabled.

  • The AI model responds without context even though Include History is enabled

  • Verify that the subsequent AI node is configured to read the history from the incoming message.
  • Check that "History Count" is greater than 1.

  • The chat shows "Offline" or "Reconnecting" status

  • This is a WebSocket connectivity issue between the browser and the server.
  • The system will attempt to reconnect automatically. If it persists, reload the page.
  • In installations with unstable connections, the chat may experience reconnection delays.

Advanced configuration (JSON Editor) — expert users only

The JSON Editor tab lets you view and directly edit the internal structure of the node. Useful for copying configurations between flows or instances.

input structure

{
  "ruleSet": {
    "session_ids": [],
    "include_history": true,
    "history_count": 20
  },
  "config": {}
}

Field table

Field Type Required Default Description
ruleSet.session_ids string[] No [] IDs of linked chat sessions. Empty = no session restriction.
ruleSet.include_history boolean No true Whether to include previous message history in the trigger payload.
ruleSet.history_count number (1-100) No 20 Number of history messages to include when include_history is true.
config {} No {} Always empty (reserved for future use).

JSON examples by use case

Conversational assistant with standard history (typical configuration)

{
  "ruleSet": {
    "session_ids": [],
    "include_history": true,
    "history_count": 20
  },
  "config": {}
}

Individual message processing without context

{
  "ruleSet": {
    "session_ids": [],
    "include_history": false,
    "history_count": 20
  },
  "config": {}
}

Assistant with extended context (long conversations)

{
  "ruleSet": {
    "session_ids": [],
    "include_history": true,
    "history_count": 50
  },
  "config": {}
}

Quick guides (recipes)

Recipe A — "Query assistant for security operators"

  • Include History: Enabled
  • History Count: 20
  • Next node: Agent Model (Claude or similar)
  • Agent prompt: facility context, access to object states
  • Action: the assistant answers questions about the status of cameras, alarms, and sensors
  • Distribute: Chat URL to the shift operations team

Recipe B — "Incident report bot for guards"

  • Include History: Disabled (each message is an independent report)
  • History Count: 1
  • Next node: Action (write to Google Sheets or send to Telegram channel)
  • Flow: the guard types "Incident: north door open" → it is automatically logged
  • Distribute: Chat URL on each patrol guard's phone

Recipe C — "Emergency assistant with extended context"

  • Include History: Enabled
  • History Count: 50
  • Next node: Agent Model with emergency protocol instructions
  • Flow: the operator describes the situation step by step → the agent guides the procedure
  • Distribute: Chat URL on the control post screen

Recipe D — "Device status query in natural language"

  • Include History: Enabled
  • History Count: 10
  • Next node: Agent Model with access to Netsocs object query tools
  • Flow: user types "Is camera 3 active?" → the agent checks the status and responds
  • Distribute: Chat URL embedded in the dashboard as a widget

Recipe E — "Alarm confirmation channel"

  • Include History: Disabled
  • History Count: 20
  • Next node: Condition (evaluate if message is "CONFIRM" or "CANCEL") → Action
  • Flow: the URL is sent to the operator when an alarm triggers; the operator types the action to take
  • Distribute: URL sent dynamically by another flow node (e.g.: Telegram with the link)

Internal references (to locate it in the editor)

  • Node key: chat_trigger
  • Class: trigger
  • Required fields: none (all have default values)
  • Chat URL: {origin}/chat/{node-id} — unique per node, generated automatically
  • Communication: real-time WebSocket with automatic reconnection
  • Typical integration: connect with AI agent nodes (Agent Model) for conversational flows