{
  "name": "Selection to Slug",
  "description": "Highlight a title or phrase, right-click, and get a clean URL slug copied straight to your clipboard.",
  "tags": [
    "slug",
    "url",
    "selection",
    "copy",
    "right-click",
    "text"
  ],
  "type": "triggered",
  "nodes": [
    {
      "id": "sticky-intro",
      "position": {
        "x": 20,
        "y": 20
      },
      "data": {
        "color": "#fff266",
        "content": "🔗 Turn a selection into a URL slug.\n\nHighlight a title or phrase on any page, right-click, and choose this workflow. It converts your selection into a lowercase, dash-separated slug and copies it to your clipboard, ready to paste."
      },
      "type": "stickyNote",
      "width": 360,
      "height": 190
    },
    {
      "id": "trigger-context-menu",
      "position": {
        "x": 120,
        "y": 300
      },
      "data": {
        "instance": {
          "id": "af-base-node:trigger:contextMenu"
        },
        "label": "Right-click a selection",
        "inputs": {
          "contexts": [
            "selection"
          ]
        },
        "parameters": {
          "notes": "Adds this workflow to the right-click menu whenever you have text selected."
        }
      },
      "type": "trigger"
    },
    {
      "id": "get-selection",
      "position": {
        "x": 420,
        "y": 470
      },
      "data": {
        "instance": {
          "id": "af-base-node:basic:getSelectedTextNode"
        },
        "label": "Get selected text",
        "inputs": {
          "outputFieldName": "selection",
          "options": {
            "includeInputFields": true
          }
        },
        "parameters": {
          "notes": "Reads the full text you highlighted on the page. The context-menu event only carries a short, truncated copy, so this node gets the complete selection reliably."
        }
      },
      "type": "basic"
    },
    {
      "id": "make-slug",
      "position": {
        "x": 440,
        "y": 300
      },
      "data": {
        "instance": {
          "id": "af-base-node:basic:text-formatter"
        },
        "label": "Make the slug",
        "inputs": {
          "operation": "slugify",
          "text": "{{ $input.selection }}"
        },
        "parameters": {
          "notes": "Converts your selection into a clean, lowercase, dash-separated slug."
        }
      },
      "type": "basic"
    },
    {
      "id": "copy-slug",
      "position": {
        "x": 760,
        "y": 300
      },
      "data": {
        "instance": {
          "id": "af-base-node:basic:clipboardWriteNode"
        },
        "label": "Copy to clipboard",
        "inputs": {
          "text": "{{ $input.result }}"
        },
        "parameters": {
          "notes": "Copies the generated slug so you can paste it anywhere."
        }
      },
      "type": "basic"
    },
    {
      "id": "notify",
      "position": {
        "x": 1080,
        "y": 300
      },
      "data": {
        "instance": {
          "id": "af-base-node:basic:showNotificationNode"
        },
        "label": "Confirm copied",
        "inputs": {
          "title": "Slug copied",
          "message": "Copied to clipboard: {{ $('Make the slug').result }}"
        },
        "parameters": {
          "notes": "Confirms the slug is on your clipboard."
        }
      },
      "type": "basic"
    }
  ],
  "edges": [
    {
      "id": "e-ctx-get-selection",
      "type": "flowEdge",
      "source": "trigger-context-menu",
      "target": "get-selection"
    },
    {
      "id": "e-trigger-slug",
      "type": "flowEdge",
      "source": "get-selection",
      "target": "make-slug"
    },
    {
      "id": "e-slug-copy",
      "type": "flowEdge",
      "source": "make-slug",
      "target": "copy-slug"
    },
    {
      "id": "e-copy-notify",
      "type": "flowEdge",
      "source": "copy-slug",
      "target": "notify"
    }
  ]
}