Actions
Actions are buttons on records that trigger workflows. They let you add custom operations like "Close Deal", "Escalate Ticket", "Send Invoice" to any entity.
Action configuration
| Property | Description |
|---|---|
| Entity | Which entity the action appears on |
| Sluq | Unique identifier within the entity |
| Label | Display text on the button (with locale support) |
| Event name | The workflow trigger identifier (e.g., deal.close) |
| EQL filter | Show the action only when the record matches this filter |
| Button style | primary, secondary, or danger |
| Button icon | Dashicon class |
| Payload template | JSON with {{field_name}} placeholders resolved at invoke time |
| Confirmation | Optional confirmation dialog before executing |
| Role gate | Which roles can see and invoke this action |
| Sort order | Order of action buttons on the record |
Action visibility
An action appears on a record when ALL of:
- The user can read the entity
- The user passes the role gate (empty = anyone who can read the entity)
- The record matches the action's EQL filter (empty = always)
Action invocation
When invoked, the action:
- Resolves the payload template against the record's current values
- Fires three WordPress hooks: -
pfm/action/<event_name>— namespaced action hook -pfm/event/<event_name>— generic event hook -pfm/action/any— catch-all for workflow subscriptions - Any workflow listening for the event name triggers
Integration with WP-PFWorkflow
Actions are the primary way to connect PFM records with WP-PFWorkflow. When you create an action and have WP-PFWorkflow installed:
- Set the action's event name (e.g.,
deal.close) - In WP-PFWorkflow, create a workflow with a "PFM record event" trigger listening for
deal.close - The workflow receives the record data + your custom payload as trigger data