Before you start
Actions must be enabled at the organization level before any action can fire. Confirm the setting in the built-in GraphiQL editor:- In ION, go to Developer Platform > GraphQL to open the GraphiQL editor.
-
Run this query to check the current setting:
-
If
enabledisfalse, an admin can turn it on with theupdateOrganizationmutation. See the API reference for the full mutation shape.
Create an action
- In ION, go to Developer Platform > Actions.
- Click Create Action. The new-action form opens on its own page, grouped into Identity, Trigger, and Logic.
- In Identity, enter a Title. It appears in the action’s error and warning messages, so keep it meaningful.
- In Trigger, set the Target record and the Event.
- Optional: in Logic, write the Python code and the Context query. See Action anatomy for what each part does. The Context query opens on a starting query that selects one record by id. Changing the Target record reshapes that starting query for the new target, but leaves a query you wrote yourself alone.
- Optional: turn on Enable on create.
- Click Create Action. The action’s page opens.
ValidationWarning saves as Warn. Any other code saves as Block, whichever option you picked. To make an action warn, see Create a warning action.
An action with no code matches every event on its target, so ION never arms one. Enable on
create stays unavailable until code is written, and an action created without code is created
paused.
edges at that level, which ION adds for you. A query that breaks these rules blocks creation. An empty query does not.
To create an action programmatically, use the createRule mutation. See the API reference for the mutation shape, and the example actions for working configurations.
Draft an action with ION Intelligence
Depending on your settings, the form carries a Write with ION control that drafts the action from a plain-language description.- On the new-action form, click Write with ION. ION Intelligence opens beside the form.
- Describe the action you want, naming the fields you want filled in.
- Wait for the answer to finish.
- Review every field, then click Create Action.
Create a warning action
A warning action lets the change save and shows a non-blocking message instead of blocking it. To make an action warn, raiseValidationWarning instead of ValidationError. Keep ruleType: VALIDATION; the exception type drives the behavior. For when to warn rather than block, see Blocking and warning.
extensions.warnings and appear as a non-blocking toast.
![Orange warning toast reading: Warning: [Rule 93] Warn when a Run Step is completed with open issues. This Run Step was completed while it still has open issues. Confirm the issues don't need to be resolved first.](https://mintcdn.com/firstresonance/3YHPQuEzl4qOwG1I/images/ion-actions/warning-actions-toast-new-ion.png?fit=max&auto=format&n=3YHPQuEzl4qOwG1I&q=85&s=8d57d9b386ca03cebacb6112f009de4f)
The warning toast ION shows after a run step completes with open issues.
Edit an action
An action’s page opens read-only. Everything on the Configuration tab is one form with one Save changes.- In ION, go to Developer Platform > Actions.
- Click the action to open its page.
- Click Edit.
- Change what you need.
- Click Save changes.
updateRule mutation. See the API reference for the mutation shape.
When someone else saved first
Because the whole form saves at once, a save that lost a race is refused as a whole. ION reports what happened, tells you nothing of yours was saved, and offers three ways out:Write a description with ION Intelligence
Depending on your settings, the Description field carries a Describe with Intelligence control that writes the description from the action’s own code, context query, target, and event. Click it on the action’s page. From read mode the description is written and saved on its own, so you can generate one without entering edit mode. Generate it while editing and it becomes an unsaved change like any other, stored by Save changes. To replace the description, click the control again.Enable or disable an action
An action’s page carries the switch, labeled Action enabled or Action disabled. It commits on its own rather than through Save changes. To change several at once, select them with the checkboxes in the Actions list and enable or disable them there. A disabled action isn’t evaluated, which lets you stage an action before turning it on in production.Review an action’s executions
Open the action and switch to the Executions tab, beside Configuration. It carries the action’s execution metrics and its filterable log. For what each log holds, see View action execution logs.Share an action across environments
To copy an action to another environment, open it and select Share in the More options (⋯) menu. ION generates the action’screateRule mutation; copy it and run it in the target environment’s GraphiQL editor to recreate the action there.
The snippet is built from what is on the form, including any unsaved edits, so save first if you want to share what is stored.
Delete an action
- In ION, go to Developer Platform > Actions.
- Delete the action and confirm. On the action’s own page, Delete sits in the More options (⋯) menu. To remove several at once, select them with the checkboxes in the Actions list and delete them together.
deleteRule mutation. See the API reference for the mutation shape.