MonetizationOS Docs

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

  1. A Component Workflow in a Surface
  2. A trigger with slug claude-visit and 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:

Surface Workflow
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.

Additional resources

On this page