Call an action from a workflow
What you'll build
Detect a specific bot in a Surface workflow and fire a custom trigger. Firing the trigger runs any Action configured for that trigger.
1. Prerequisites
- A Component Workflow in a Surface
- A trigger with slug
claude-visitand an Action that listens to it. See Send a Slack message from an Action for a complete example.
2. Fire the trigger from the surface
Update the surface workflow to detect Claude and fire the claude-visit trigger:
const : = async ({ , , }) => {
const = ..(
() => . === "Claude User" || . === "Anthropic",
);
if () {
await ..(
"claude-visit",
{ : . },
,
);
}
return {};
};
export default ;Result
When Claude visits the surface, the workflow fires claude-visit. Any action configured for that trigger runs asynchronously with the payload you passed to utils.triggers.fire.