{
  "workflow_name": "Distribute new posts differently by author role",
  "workflow_steps": {
    "steps": [
      {
        "id": "1",
        "position": {
          "x": 0,
          "y": 0
        },
        "data": {
          "label": "New Post Published",
          "app": {
            "key": "wordpress",
            "fm_app": "wordpress"
          },
          "eventSlug": "new_post",
          "eventTitle": "New Post",
          "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": "wordpress",
        "stepID": "1",
        "action": "new_post",
        "nodeType": "step",
        "actionAppArgs": [],
        "captureResponse": {
          "post_id": "555",
          "post_title": "How we automate onboarding",
          "post_content": "Full article body goes here...",
          "post_excerpt": "A behind-the-scenes look...",
          "post_author": "3",
          "permalink": "https://example.com/blog/onboarding"
        },
        "responses": [
          {
            "letter": "A",
            "time": "01/07/2026, 10:00:00",
            "response": {
              "post_id": "555",
              "post_title": "How we automate onboarding",
              "post_content": "Full article body goes here...",
              "post_excerpt": "A behind-the-scenes look...",
              "post_author": "3",
              "permalink": "https://example.com/blog/onboarding"
            }
          }
        ],
        "activeResponseIndex": 0
      },
      {
        "id": "2",
        "position": {
          "x": 175,
          "y": 0
        },
        "type": "action",
        "data": {
          "label": "Look up the author",
          "layoutDirection": "horizontal",
          "stepNumber": 2,
          "app": {
            "key": "wordpress",
            "fm_app": "wordpress"
          },
          "eventSlug": "get_user_by_id",
          "eventTitle": "Get User by ID"
        },
        "parentType": "step",
        "style": {
          "transition": "all 150ms ease-in-out"
        },
        "measured": {
          "width": 82,
          "height": 82
        },
        "actionAppArgs": {
          "user_id": "{wordpress1.post_author}"
        },
        "application": "wordpress",
        "action": "get_user_by_id",
        "nodeType": "step",
        "stepID": "2"
      },
      {
        "id": "3",
        "position": {
          "x": 350,
          "y": 0
        },
        "nodeType": "router",
        "application": "router",
        "stepID": "3",
        "type": "action",
        "actionAppArgs": [],
        "data": {
          "label": "Router",
          "app": {
            "key": "router",
            "fm_app": "router"
          },
          "layoutDirection": "horizontal",
          "stepNumber": 3,
          "stepIndex": 3
        },
        "parentType": "step"
      },
      {
        "id": "3-routerSwitch",
        "position": {
          "x": 450,
          "y": 0
        },
        "type": "action",
        "data": {
          "label": "+",
          "stepNumber": null,
          "layoutDirection": "horizontal",
          "app": []
        },
        "routerSwitch": true,
        "stepID": "3-routerSwitch",
        "nodeType": "routerSwitch",
        "actionAppArgs": []
      },
      {
        "id": "3-routerRoute_A",
        "position": {
          "x": 570,
          "y": -225.0
        },
        "type": "action",
        "data": {
          "label": "Route A",
          "stepNumber": null,
          "layoutDirection": "horizontal",
          "app": [],
          "customLabel": "Editor role"
        },
        "routerRoute": true,
        "routeLetter": "A",
        "routeIndex": 0,
        "stepID": "3-routerRoute_A",
        "nodeType": "routerRoute",
        "actionAppArgs": []
      },
      {
        "id": "4",
        "position": {
          "x": 790,
          "y": -225.0
        },
        "type": "action",
        "data": {
          "label": "Route Conditions",
          "layoutDirection": "horizontal",
          "stepNumber": 4,
          "app": {
            "key": "filter",
            "fm_app": "filter"
          },
          "eventSlug": "continue_if",
          "eventTitle": "Route Conditions",
          "customLabel": "Route Conditions"
        },
        "parentType": "routerRoute",
        "style": {
          "transition": "all 150ms ease-in-out"
        },
        "measured": {
          "width": 82,
          "height": 82
        },
        "actionAppArgs": {
          "filterConditions": {
            "1": [
              {
                "key": "{wordpress2.wp_capabilities}",
                "condition": "contain_text",
                "value": "\"editor\""
              }
            ]
          }
        },
        "application": "filter",
        "action": "continue_if",
        "nodeType": "step",
        "stepID": "4",
        "filterConditions": {
          "filterConditions": {
            "1": [
              {
                "key": "{wordpress2.wp_capabilities}",
                "condition": "contain_text",
                "value": "\"editor\""
              }
            ]
          }
        }
      },
      {
        "id": "5",
        "position": {
          "x": 965,
          "y": -225.0
        },
        "type": "action",
        "data": {
          "label": "Post to the team channel",
          "layoutDirection": "horizontal",
          "stepNumber": 5,
          "app": {
            "key": "slack",
            "fm_app": "slack"
          },
          "eventSlug": "send_message_to_channel",
          "eventTitle": "Send Channel Message"
        },
        "parentType": "step",
        "style": {
          "transition": "all 150ms ease-in-out"
        },
        "measured": {
          "width": 82,
          "height": 82
        },
        "actionAppArgs": {
          "message_text": "Editor post live: {wordpress1.post_title} - {wordpress1.permalink}"
        },
        "application": "slack",
        "action": "send_message_to_channel",
        "nodeType": "step",
        "stepID": "5"
      },
      {
        "id": "3_A_placeholder",
        "position": {
          "x": 1140,
          "y": -225.0
        },
        "type": "placeholder",
        "data": {
          "label": "+",
          "layoutDirection": "horizontal",
          "stepNumber": null,
          "app": []
        },
        "measured": {
          "width": 40,
          "height": 82
        },
        "stepID": "3_A_placeholder",
        "nodeType": "placeholder",
        "actionAppArgs": []
      },
      {
        "id": "3-routerRoute_B",
        "position": {
          "x": 570,
          "y": 0.0
        },
        "type": "action",
        "data": {
          "label": "Route B",
          "stepNumber": null,
          "layoutDirection": "horizontal",
          "app": [],
          "customLabel": "Contributor role"
        },
        "routerRoute": true,
        "routeLetter": "B",
        "routeIndex": 1,
        "stepID": "3-routerRoute_B",
        "nodeType": "routerRoute",
        "actionAppArgs": []
      },
      {
        "id": "6",
        "position": {
          "x": 790,
          "y": 0.0
        },
        "type": "action",
        "data": {
          "label": "Route Conditions",
          "layoutDirection": "horizontal",
          "stepNumber": 6,
          "app": {
            "key": "filter",
            "fm_app": "filter"
          },
          "eventSlug": "continue_if",
          "eventTitle": "Route Conditions",
          "customLabel": "Route Conditions"
        },
        "parentType": "routerRoute",
        "style": {
          "transition": "all 150ms ease-in-out"
        },
        "measured": {
          "width": 82,
          "height": 82
        },
        "actionAppArgs": {
          "filterConditions": {
            "1": [
              {
                "key": "{wordpress2.wp_capabilities}",
                "condition": "contain_text",
                "value": "\"contributor\""
              }
            ]
          }
        },
        "application": "filter",
        "action": "continue_if",
        "nodeType": "step",
        "stepID": "6",
        "filterConditions": {
          "filterConditions": {
            "1": [
              {
                "key": "{wordpress2.wp_capabilities}",
                "condition": "contain_text",
                "value": "\"contributor\""
              }
            ]
          }
        }
      },
      {
        "id": "7",
        "position": {
          "x": 965,
          "y": 0.0
        },
        "type": "action",
        "data": {
          "label": "Promote contributor post",
          "layoutDirection": "horizontal",
          "stepNumber": 7,
          "app": {
            "key": "telegram",
            "fm_app": "telegram"
          },
          "eventSlug": "send_message",
          "eventTitle": "Send a Text Message"
        },
        "parentType": "step",
        "style": {
          "transition": "all 150ms ease-in-out"
        },
        "measured": {
          "width": 82,
          "height": 82
        },
        "actionAppArgs": {
          "text": "Contributor post: {wordpress1.post_title} - {wordpress1.permalink}",
          "parse_mode": "HTML"
        },
        "application": "telegram",
        "action": "send_message",
        "nodeType": "step",
        "stepID": "7"
      },
      {
        "id": "3_B_placeholder",
        "position": {
          "x": 1140,
          "y": 0.0
        },
        "type": "placeholder",
        "data": {
          "label": "+",
          "layoutDirection": "horizontal",
          "stepNumber": null,
          "app": []
        },
        "measured": {
          "width": 40,
          "height": 82
        },
        "stepID": "3_B_placeholder",
        "nodeType": "placeholder",
        "actionAppArgs": []
      },
      {
        "id": "3-routerRoute_C",
        "position": {
          "x": 570,
          "y": 225.0
        },
        "type": "action",
        "data": {
          "label": "Route C",
          "stepNumber": null,
          "layoutDirection": "horizontal",
          "app": [],
          "customLabel": "Author role"
        },
        "routerRoute": true,
        "routeLetter": "C",
        "routeIndex": 2,
        "stepID": "3-routerRoute_C",
        "nodeType": "routerRoute",
        "actionAppArgs": []
      },
      {
        "id": "8",
        "position": {
          "x": 790,
          "y": 225.0
        },
        "type": "action",
        "data": {
          "label": "Route Conditions",
          "layoutDirection": "horizontal",
          "stepNumber": 8,
          "app": {
            "key": "filter",
            "fm_app": "filter"
          },
          "eventSlug": "continue_if",
          "eventTitle": "Route Conditions",
          "customLabel": "Route Conditions"
        },
        "parentType": "routerRoute",
        "style": {
          "transition": "all 150ms ease-in-out"
        },
        "measured": {
          "width": 82,
          "height": 82
        },
        "actionAppArgs": {
          "filterConditions": {
            "1": [
              {
                "key": "{wordpress2.wp_capabilities}",
                "condition": "contain_text",
                "value": "\"author\""
              }
            ]
          }
        },
        "application": "filter",
        "action": "continue_if",
        "nodeType": "step",
        "stepID": "8",
        "filterConditions": {
          "filterConditions": {
            "1": [
              {
                "key": "{wordpress2.wp_capabilities}",
                "condition": "contain_text",
                "value": "\"author\""
              }
            ]
          }
        }
      },
      {
        "id": "9",
        "position": {
          "x": 965,
          "y": 225.0
        },
        "type": "action",
        "data": {
          "label": "Notify editors",
          "layoutDirection": "horizontal",
          "stepNumber": 9,
          "app": {
            "key": "email",
            "fm_app": "email"
          },
          "eventSlug": "send_email",
          "eventTitle": "Send Email"
        },
        "parentType": "step",
        "style": {
          "transition": "all 150ms ease-in-out"
        },
        "measured": {
          "width": 82,
          "height": 82
        },
        "actionAppArgs": {
          "to_email": "editors@yourco.com",
          "email_subject": "New author post published",
          "email_body": "{wordpress1.post_title} is live at {wordpress1.permalink}."
        },
        "application": "email",
        "action": "send_email",
        "nodeType": "step",
        "stepID": "9"
      },
      {
        "id": "3_C_placeholder",
        "position": {
          "x": 1140,
          "y": 225.0
        },
        "type": "placeholder",
        "data": {
          "label": "+",
          "layoutDirection": "horizontal",
          "stepNumber": null,
          "app": []
        },
        "measured": {
          "width": 40,
          "height": 82
        },
        "stepID": "3_C_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-3-routerSwitch",
        "source": "3",
        "target": "3-routerSwitch",
        "type": "router",
        "data": []
      },
      {
        "id": "e-3-routerSwitch-3-routerRoute_A",
        "source": "3-routerSwitch",
        "target": "3-routerRoute_A",
        "type": "router",
        "data": []
      },
      {
        "id": "e-3-routerRoute_A-4",
        "source": "3-routerRoute_A",
        "target": "4",
        "type": "router",
        "data": []
      },
      {
        "id": "e-4-5",
        "source": "4",
        "target": "5",
        "type": "step",
        "data": []
      },
      {
        "id": "e-5-3_A_placeholder",
        "source": "5",
        "target": "3_A_placeholder",
        "type": "placeholder",
        "data": []
      },
      {
        "id": "e-3-routerSwitch-3-routerRoute_B",
        "source": "3-routerSwitch",
        "target": "3-routerRoute_B",
        "type": "router",
        "data": []
      },
      {
        "id": "e-3-routerRoute_B-6",
        "source": "3-routerRoute_B",
        "target": "6",
        "type": "router",
        "data": []
      },
      {
        "id": "e-6-7",
        "source": "6",
        "target": "7",
        "type": "step",
        "data": []
      },
      {
        "id": "e-7-3_B_placeholder",
        "source": "7",
        "target": "3_B_placeholder",
        "type": "placeholder",
        "data": []
      },
      {
        "id": "e-3-routerSwitch-3-routerRoute_C",
        "source": "3-routerSwitch",
        "target": "3-routerRoute_C",
        "type": "router",
        "data": []
      },
      {
        "id": "e-3-routerRoute_C-8",
        "source": "3-routerRoute_C",
        "target": "8",
        "type": "router",
        "data": []
      },
      {
        "id": "e-8-9",
        "source": "8",
        "target": "9",
        "type": "step",
        "data": []
      },
      {
        "id": "e-9-3_C_placeholder",
        "source": "9",
        "target": "3_C_placeholder",
        "type": "placeholder",
        "data": []
      }
    ]
  },
  "workflow_settings": {
    "name": "Distribute new posts differently by author role",
    "folder": "all",
    "description": "When a post is published, FlowMattic looks up its author and reads the author's WordPress role from the wp_capabilities user meta (change the key if your database prefix is not wp_). A Router sends each post down one path: editor posts to Slack, contributor posts to Telegram and author posts to email.",
    "status": "off",
    "user_email": "",
    "webhook_queue": "disabled",
    "workflow_auth_key": "",
    "builder_version": "v2",
    "time": "",
    "ai_generated": "yes"
  }
}