{
  "workflow_name": "Spot unhappy customers in replies and warn the retention team",
  "workflow_steps": {
    "steps": [
      {
        "id": "1",
        "position": {
          "x": 0,
          "y": 0
        },
        "data": {
          "label": "Customer Replies",
          "app": {
            "key": "fluent_support",
            "fm_app": "fluent_support"
          },
          "eventSlug": "customer_replies_ticket",
          "eventTitle": "Customer Replies to a Ticket",
          "layoutDirection": "horizontal",
          "stepNumber": 1
        },
        "targetPosition": "bottom",
        "type": "trigger",
        "stepNumber": 1,
        "expanded": true,
        "style": {
          "transition": "all 150ms ease-in-out"
        },
        "measured": {
          "width": 82,
          "height": 82
        },
        "application": "fluent_support",
        "stepID": "1",
        "action": "customer_replies_ticket",
        "nodeType": "step",
        "actionAppArgs": [],
        "captureResponse": {
          "ticket_id": "778",
          "subject": "Checkout is failing",
          "content": "I can't complete my purchase.",
          "customer_name": "Dana Fox",
          "customer_email": "dana@example.com",
          "customer_phone": "+15551112222",
          "priority": "urgent",
          "status": "open",
          "product": "Pro Plan"
        },
        "responses": [
          {
            "letter": "A",
            "time": "01/07/2026, 10:00:00",
            "response": {
              "ticket_id": "778",
              "subject": "Checkout is failing",
              "content": "I can't complete my purchase.",
              "customer_name": "Dana Fox",
              "customer_email": "dana@example.com",
              "customer_phone": "+15551112222",
              "priority": "urgent",
              "status": "open",
              "product": "Pro Plan"
            }
          }
        ],
        "activeResponseIndex": 0
      },
      {
        "id": "2",
        "position": {
          "x": 175,
          "y": 0
        },
        "type": "action",
        "data": {
          "label": "AI Agent by FlowMattic",
          "layoutDirection": "horizontal",
          "stepNumber": 2,
          "stepIndex": 2,
          "app": {
            "key": "ai_agent",
            "fm_app": "ai_agent"
          },
          "eventSlug": "execute_agent",
          "eventTitle": "Execute Agent"
        },
        "parentType": "step",
        "style": {
          "transition": "all 150ms ease-in-out"
        },
        "measured": {
          "width": 350,
          "height": 82
        },
        "actionAppArgs": {
          "system_prompt": "You are a retention-focused support agent. Judge the customer's mood, reply with empathy, and alert retention on Slack only if they seem frustrated or likely to leave.",
          "user_input": "Latest reply: {fluent_support1.content}\nTicket: {fluent_support1.subject}",
          "output_format": "text",
          "application": "ai_agent",
          "responseViewType": "on",
          "include_execution_log": "",
          "include_request_body": ""
        },
        "application": "ai_agent",
        "stepID": "2",
        "nodeType": "aiAgent",
        "agent_config": {
          "chat_model": {
            "connect_id": "",
            "model_id": "gpt-4o",
            "model_name": "GPT-4o",
            "provider": "openai",
            "max_tokens": "1024",
            "temperature": "0.7",
            "top_p": "1",
            "top_k": "0",
            "frequency_penalty": "0",
            "presence_penalty": "0",
            "nodeId": "2-chatModel",
            "position": {
              "x": 215,
              "y": 172
            }
          },
          "tools": [
            {
              "app": "fluent_support",
              "app_name": "Fluent Support",
              "app_icon": "",
              "action": "reply_to_ticket",
              "action_title": "Reply to Ticket",
              "tool_name": "Fluent Support - Reply to Ticket",
              "tool_description": "Reply with empathy",
              "actionAppArgs": {
                "ticketId": "{fluent_support1.ticket_id}",
                "response_id": "AI:"
              },
              "configured": true,
              "sourceNodeId": "2-tool"
            },
            {
              "app": "slack",
              "app_name": "Slack",
              "app_icon": "",
              "action": "send_message_to_channel",
              "action_title": "Send Channel Message",
              "tool_name": "Slack - Send Channel Message",
              "tool_description": "Warn retention if at risk",
              "actionAppArgs": {
                "message_text": "AI:"
              },
              "configured": true,
              "sourceNodeId": "2-tool"
            },
            {
              "app": "fluent_support",
              "app_name": "Fluent Support",
              "app_icon": "",
              "action": "add_tag_to_ticket",
              "action_title": "Add Tag to Ticket (Pro)",
              "tool_name": "Fluent Support - Add Tag to Ticket (Pro)",
              "tool_description": "Tag sentiment",
              "actionAppArgs": {
                "ticketId": "{fluent_support1.ticket_id}",
                "tag_id": "AI:"
              },
              "configured": true,
              "sourceNodeId": "2-tool"
            }
          ]
        }
      },
      {
        "id": "3",
        "position": {
          "x": 350,
          "y": 0
        },
        "type": "action",
        "data": {
          "label": "Log to CRM",
          "layoutDirection": "horizontal",
          "stepNumber": 3,
          "app": {
            "key": "fluentcrm",
            "fm_app": "fluentcrm"
          },
          "eventSlug": "add_note_to_contact",
          "eventTitle": "Add Note to Contact"
        },
        "parentType": "step",
        "style": {
          "transition": "all 150ms ease-in-out"
        },
        "measured": {
          "width": 82,
          "height": 82
        },
        "actionAppArgs": {
          "contact_email": "{fluent_support1.customer_email}",
          "note_title": "Support sentiment check",
          "note_content": "AI reviewed reply on ticket #{fluent_support1.ticket_id}."
        },
        "application": "fluentcrm",
        "action": "add_note_to_contact",
        "nodeType": "step",
        "stepID": "3"
      },
      {
        "id": "main_end_placeholder",
        "position": {
          "x": 525,
          "y": 0
        },
        "type": "placeholder",
        "data": {
          "label": "+",
          "layoutDirection": "horizontal",
          "stepNumber": null,
          "app": []
        },
        "measured": {
          "width": 40,
          "height": 82
        },
        "stepID": "main_end_placeholder",
        "nodeType": "placeholder",
        "actionAppArgs": []
      }
    ],
    "edges": [
      {
        "id": "e-1-2",
        "source": "1",
        "target": "2",
        "type": "step",
        "data": []
      },
      {
        "id": "e-2-3",
        "source": "2",
        "target": "3",
        "type": "step",
        "data": []
      },
      {
        "id": "e-3-main_end_placeholder",
        "source": "3",
        "target": "main_end_placeholder",
        "type": "placeholder",
        "data": []
      }
    ]
  },
  "workflow_settings": {
    "name": "Spot unhappy customers in replies and warn the retention team",
    "folder": "all",
    "description": "Each customer reply is read by an AI agent that gauges sentiment, answers empathetically, and pings the retention channel when it detects churn risk.",
    "status": "off",
    "user_email": "",
    "webhook_queue": "disabled",
    "workflow_auth_key": "",
    "builder_version": "v2",
    "time": "",
    "ai_generated": "yes"
  }
}