Automation Flows
An automation flow listens for one C2 event and runs its enabled steps in order. Start with one safe action and a test profile; a flow can send Discord messages or change member data without a human review step.
Before you create a flow
You need the community_automation community feature. C2 routes use these permissions:
| Task | Permission |
|---|---|
| Open the flow list | automation:read |
| Create a flow | automation:create |
| Edit a flow | automation:update |
| Delete a flow | automation:delete |
| Read its execution log | automation-logs:read |
Also make sure the target exists before selecting it: Discord channel, Discord member/role, rank, unit, position, C2 role, qualification, or award. A flow cannot use a target that the selected community does not provide.
Create a flow
- Open Automation and select Create Flow.
- Enter a clear Name, an optional description, and select an Event type.
- Leave Enabled off while you finish the first test, if appropriate.
- Add at least one step and choose its Action type.
- Complete the configuration required by that action.
- Optionally add conditions to restrict when the flow runs.
- Select Create Flow. C2 returns to the flow list after a successful save.
The create button stays unavailable until a name, event type, action type, valid conditions, and valid action configurations are present. A 402 feature limit reached response means the community feature limit blocked the save; it is not a missing staff permission.
Available triggers
The API currently exposes these trigger choices:
COMMUNITY_PROFILE_CREATEDCOMMUNITY_PROFILE_UPDATEDCOMMUNITY_RANKS_CREATEDCOMMUNITY_RANKS_UPDATEDCOMMUNITY_EVENTS_CREATEDCOMMUNITY_EVENTS_UPDATEDCOMMUNITY_APPLICATION_SUBMISSION_CREATEDCOMMUNITY_APPLICATION_SUBMISSION_UPDATED
Choose the smallest trigger that matches the outcome. For example, onboarding normally starts with COMMUNITY_PROFILE_CREATED; an applicant-review notification normally starts with COMMUNITY_APPLICATION_SUBMISSION_CREATED.
Add conditions
Turn on conditions only when the trigger alone is too broad. The visual builder can combine rules using all or any logic and supports EQ, NEQ, IN, NOT_IN, EXISTS, NOT_EXISTS, CONTAINS, NOT_CONTAINS, GT, GTE, LT, and LTE.
Conditions can use top-level event data (eventType, action, entityType, entityId, communityId, triggeredBy, occurredAt) and event-specific payload fields. Check the generated preview/validation before saving. An invalid condition blocks the save rather than silently broadening the flow.
Configure a step
Steps run in their displayed order. Use the up/down controls to reorder, Add step to add one, and the bin control to remove one. C2 always retains at least one step.
| Action family | Available actions | Result |
|---|---|---|
| Discord message | DISCORD_DM, DISCORD_CHANNEL_MESSAGE | Sends a direct or channel message. Messages may include event placeholders. |
| Discord account | DISCORD_ADD_ROLE, DISCORD_REMOVE_ROLE, DISCORD_UPDATE_USERNAME | Changes the selected Discord member or role. |
| Primary profile assignment | PROFILE_SET_RANK, PROFILE_SET_POSITION, PROFILE_SET_UNIT | Sets one rank, position, or unit. |
| Profile membership | PROFILE_ADD_ROLES, PROFILE_REMOVE_ROLES, PROFILE_ADD_QUALIFICATIONS, PROFILE_REMOVE_QUALIFICATIONS, PROFILE_ADD_AWARDS, PROFILE_REMOVE_AWARDS, PROFILE_ADD_UNITS, PROFILE_REMOVE_UNITS, PROFILE_ADD_POSITIONS, PROFILE_REMOVE_POSITIONS | Adds or removes the selected C2 assignments. |
For message steps, use plain text first. Add variables only after a test confirms the output. The event object provides top-level values such as ${eventType}, ${entityType}, ${entityId}, ${communityId}, ${triggeredBy}, ${action}, and ${occurredAt}. Payload values vary by trigger, so do not copy a profile-only value into a rank or event flow.
Edit, disable, or delete a flow
Open a flow and select Edit. You can change the event type, enabled toggle, condition, steps, order, and configuration, then select Save. Cancel abandons the unsaved edit state.
Use the Enabled toggle to stop a flow without deleting its configuration. Select the delete control from the list only when you no longer need the flow; it opens a confirmation dialog and is destructive.
Test and recover safely
- Keep the flow disabled while building it.
- Create a test profile or test event that matches the intended trigger.
- Enable the flow and trigger it once.
- Confirm the resulting profile change or Discord message.
- Open Automation → Logs and check every step.
If a test fails, correct the named step or missing target, then trigger a new test. Do not keep retriggering a live workflow: repeated messages or assignments are possible outcomes.
Access and technical reference
The flow controller is feature-gated with community_automation, and standard flow operations derive their automation:* permission from the HTTP action. C2 gets trigger options from /community/:communityId/automation/flows/events and action types from /community/:communityId/automation/actions/types.
The action-types controller currently has no CommunityPermissionCheck annotation. Test whether a read-only staff account can retrieve configuration options before treating that endpoint as access-controlled.