diff --git a/web/src/components/app/automations/AutomationFlow.tsx b/web/src/components/app/automations/AutomationFlow.tsx index df35db41..dc9cd7a6 100644 --- a/web/src/components/app/automations/AutomationFlow.tsx +++ b/web/src/components/app/automations/AutomationFlow.tsx @@ -38,6 +38,7 @@ import { CheckCircle2Icon, CheckIcon, CheckSquareIcon, + CopyIcon, GitBranchIcon, GlobeIcon, HistoryIcon, @@ -101,8 +102,10 @@ import { isNativeAction, nativeActionNeeds, triggerCarriesThread, + triggerIsInboundWebhook, type TriggerFieldDef, } from "@/lib/api/models/app/automations/meta"; +import { API_URL } from "@/lib/information"; import CategoryPicker from "@/components/app/contacts/CategoryPicker"; import { ExpressionReference } from "@/components/app/automations/ExpressionReference"; import DealStagePicker from "@/components/app/crm/DealStagePicker"; @@ -1083,6 +1086,7 @@ export default function AutomationFlow({ setTrigger(ev); updateNodeData("trigger", { label: triggerLabel(ev) }); }} + inboundUrl={automation.inbound_url} // condition onCondition={(cond) => updateNodeData(selectedNode.id, { condition: cond, label: conditionLabel(cond) })} // action @@ -1257,6 +1261,56 @@ function InsightsPanel({ ); } +// InboundUrlField shows the automation's unique inbound-webhook URL (read-only) +// with a copy button. The stored value is a path; we prefix the API origin so +// the copied value is the full URL an external system POSTs to. +function InboundUrlField({ inboundUrl }: { inboundUrl?: string }) { + const [copied, setCopied] = React.useState(false); + if (!inboundUrl) { + return ( +
+ Save this automation to generate its unique webhook URL. An external system POSTs JSON to that URL and
+ the body becomes the event payload (reference any field with {"{{.field}}"}).
+
+ POST JSON here to run this automation. The body becomes the event payload, so reference its keys with{" "}
+ {"{{.field}}"} in actions and conditions.
+
- Add a condition (IF) below the trigger to branch on the event — e.g. only positive replies, or by source. -
+ {triggerIsInboundWebhook(trigger) ? ( ++ Add a condition (IF) below the trigger to branch on the event — e.g. only positive replies, or by source. +
+ )} > ) : isCondition ? (