Search documentation

Search for docs or ask AI

Actions

Actions are the bridge between Pillar's co-pilot and your application. They represent things users can do—like navigating to a page, opening a modal, or triggering a workflow—and the co-pilot suggests them when relevant.

Why Actions Matter

Without actions, the co-pilot can only answer questions. With actions, it becomes an assistant that helps users do things:

Without ActionsWith Actions
"Here's how to invite a team member...""Here's how to invite a team member. [Invite Team Member]"
User reads instructions, navigates manuallyUser clicks the action, modal opens automatically

Actions turn help content into executable guidance.

How It Works

1
You define actions in your code

Describe what each action does in natural language the AI can understand.

2
User asks a question

"How do I change my billing plan?"

3
AI matches intent to actions

The co-pilot finds your "Upgrade Plan" action based on semantic similarity.

4
User clicks the suggested action

Your handler runs—navigates to billing, opens the upgrade modal, whatever you defined.

Action Types

Pillar supports five action types for different use cases:

TypeWhat It DoesExample
navigateGoes to a page in your appSettings, dashboard, detail pages
trigger_actionRuns your custom logicOpens modals, starts wizards, toggles features
inline_uiShows interactive UI in the chatConfirmation forms, data previews
external_linkOpens a URL in a new tabDocumentation, external resources
copy_textCopies text to clipboardAPI keys, code snippets

Auto-Run Behavior

Some actions run automatically without user confirmation:

  • navigate actions auto-run by default (just takes user to a page)
  • external_link actions auto-run (opens a new tab)
  • trigger_action requires user confirmation (executes custom logic)

You can override this with the autoRun property on any action.

Data Extraction

Actions can define a dataSchema that tells the co-pilot what data to extract from the conversation:

ts
{
name: 'invite_member',
dataSchema: {
email: { type: 'string', description: 'Email address to invite' },
role: { type: 'string', enum: ['admin', 'member', 'viewer'] },
},
}

When the action runs, your handler receives the extracted data:

ts
onTask('invite_member', (data) => {
// data.email and data.role are populated from the conversation
inviteUser(data.email, data.role);
});

Context Requirements

Actions can specify required context to only appear in relevant situations:

  • An "Edit Project" action only appears when context.projectId is set
  • An "Admin Settings" action only appears when context.userRole === 'admin'

This keeps suggestions relevant and prevents users from seeing actions they can't execute.

Composability with Plans

When users ask for help with complex tasks, the co-pilot automatically chains your actions into Plans—multi-step checklists that guide users through workflows.

You don't need to define these workflows explicitly. Just define focused, single-purpose actions, and the AI composes them as needed.

Next Steps