Skip to content

MngGetWorkflowTriggers

Returns workflow trigger definitions from the backend registry as a table: structure names the columns and every row is an array of values in that order. Without limit all matching triggers are returned.

Response format changed

Rows are positional arrays read against structure, not objects, and the response now carries count. Earlier versions returned rows as an array of trigger objects. Read every value by the index of its name in structure.

Access

Manager sessions: SESSION_MANAGER, SESSION_ADMIN, SESSION_DEALER, SESSION_CRM_MANAGER, SESSION_CRM_ADMIN.

Request Parameters

Name Type Required Description
scope int No 0 CRM, 1 BO, 2 both/all
limit int No From 1 to 1000. Omitted means all triggers
offset int No Default 0
where array No [[field, operator, value], ...]
orWhere array No OR comparison group in [[field, operator, value], ...] format; at least one condition must match
whereNot array No [[field, value], ...]
whereIn array No [[field, [values...]], ...]
whereNotIn array No [[field, [values...]], ...]
whereBetween array No [[field, [from, to]], ...]
whereNotBetween array No [[field, [from, to]], ...]
orderBy array No One sort column, for example [["code", "asc"]]. Default: code ascending

Fields available in filters and orderBy:

Field Type
code, entity_type string
scope, payload_type int

Operators: =, ==, !=, >, <, >=, <=, like. String comparison is case-insensitive, and string like matches a substring (% characters are ignored); strings support only =, ==, != and like. Conditions on other fields, or with a value of another type, do not match. allowed_actions and allowed_conditions are not filterable. Filters apply inside the session scope described below.

Scope filtering:

0 = CRM, returns CRM + BOTH triggers
1 = BO, returns BO + BOTH triggers
2 = BOTH, returns all triggers

If scope is omitted, backend infers it from __access.type:

SESSION_CRM_MANAGER / SESSION_CRM_ADMIN -> CRM
SESSION_MANAGER / SESSION_DEALER        -> BO
SESSION_ADMIN                           -> BOTH

For non-admin BO/CRM sessions backend always enforces session scope, even if client sends scope = 2.

Request

{
  "command": "MngGetWorkflowTriggers",
  "extID": "1",
  "data": {
    "scope": 0,
    "where": [
      ["code", "==", "cashier.deposit.created"]
    ]
  }
}

Response Data

Field Type Description
structure string[] Column names, in the order of values in every row
rows array[] Matching triggers for the requested page
count int Number of triggers matching all filters, before limit and offset

Columns:

Column Type Description
code string Trigger code
scope int 0 CRM, 1 BO, 2 both
payload_type int Payload type of the trigger event
entity_type string Entity the trigger is raised for
allowed_actions string[] Server action codes the trigger exposes. Provider actions are not listed here; MngGetWorkflowActionsByTrigger returns them
allowed_conditions string[] Condition fields the trigger exposes
{
  "structure": [
    "code",
    "scope",
    "payload_type",
    "entity_type",
    "allowed_actions",
    "allowed_conditions"
  ],
  "rows": [
    [
      "cashier.deposit.created",
      0,
      7,
      "cashier_transaction",
      [
        "customer.set_lifecycle_flags",
        "customer.convert_lead_to_client",
        "customer.convert_client_to_lead",
        "customer.set_status",
        "customer.attach_desk"
      ],
      [
        "brand",
        "amount_usd",
        "cashier.id",
        "cashier.customer_id",
        "cashier.login",
        "cashier.amount",
        "cashier.converted_amount",
        "cashier.currency",
        "cashier.account_currency",
        "cashier.provider",
        "cashier.method",
        "cashier.source",
        "account.group",
        "account.country",
        "customer.country",
        "customer.language",
        "customer.email",
        "customer.kyc_status",
        "customer.risk_level",
        "customer.lifecycle_flags",
        "customer.kind",
        "customer.deposits_count"
      ]
    ]
  ],
  "count": 1
}

Use this method first when building a workflow rule editor.

kyc.profile.submitted starts when a customer submits a KYC profile.

Cashier approval workflow triggers are:

  • cashier.deposit.approved for a successfully credited manual deposit;
  • cashier.withdrawal.approved for a successfully completed manual withdrawal.

Both have CRM scope, payload type 7, entity type cashier_transaction, and expose the cashier.publish_approved action. That action publishes the corresponding outbound Moleculer event. A rule is therefore required for external publication.

Cashier request workflow triggers are:

  • cashier.deposit.created when a cashier deposit request is created;
  • cashier.withdrawal.created when a cashier withdrawal request is created.

They start for every creation path — MngCreateManualCashierDeposit, MngCreateManualCashierWithdrawal, CreateCashierDeposit, CreateCashierWithdrawal — before approval and before any balance movement. There is no status filter: a request is created as CREATED (0), PENDING_PAYMENT (1) or MANUAL_REVIEW (9), never as CREDITED / COMPLETED, so the created and approved triggers of one transaction start at different moments. They have CRM scope, payload type 7 and entity type cashier_transaction, and expose the actions and conditions of the matching approved trigger except the action cashier.publish_approved and the condition cashier.approved_by (always 0 at creation). On cashier.deposit.created, customer.deposits_count does not include the current request, because it is not credited yet. Actions run on an unpaid request and are not reverted if it is later declined.

All four cashier triggers also offer provider actions with the CASHIER payload type, such as mailer.send_template — see Workflow provider actions.

The trigger account.margin_call.alert starts only when an account enters MARGINLEVEL_MARGINCALL; unchanged Margin Call recalculations, Stop Out and recovery do not start it. It has scope 2, so both BackOffice and CRM sessions receive it, payload type 8 and entity type account. It exposes the account.margin_call.publish action for conditional Moleculer publication; provider actions with the MARGIN payload type, such as mailer.send_template, are offered as well — see Workflow provider actions. account.margin_call.publish itself keeps scope 1; actions are not filtered by scope, so CRM lists it for this trigger too.

Finance operation workflow triggers are:

  • account.balance_in.created for an applied OP_BALANCE_IN finance record;
  • account.balance_out.created for an applied OP_BALANCE_OUT finance record;
  • account.credit_in.created for an applied OP_CREDIT_IN finance record.

They start for an applied operation from any source — BackOffice commands, executed CRM finance requests, plugins and the cashier — and have scope 2, payload type 1 and entity type trade. They are named by the operation command on the account. Do not confuse them with the cashier.* triggers, which describe cashier requests.

Name history: until 2026-10-27 — deposit.created, withdrawal.created, credit.created; on 2026-10-27 — internal.deposit.created, internal.withdrawal.created, internal.credit.created; since 2026-10-28 — account.*. The server migrations 20261027_workflow_rename_internal_finance_triggers and 20261028_workflow_rename_account_finance_triggers rewrote the trigger of stored rules (the second one also renames the action bonus.grant to account.bonus.grant); run history keeps the old names.

account.balance_in.created exposes, in addition to notification, CRM and compliance actions, the restricted account.bonus.grant action. Its conditions may use the balance-in amount, login, reason, comment, brand, account group and customer context.

account.balance_out.created exposes, in addition to notification and compliance actions, the same restricted account.bonus.grant action (since 2026-11-17). The bonus goes to the account the balance was withdrawn from; a percentage is taken from the absolute withdrawal amount — see account.bonus.grant. Its conditions are those of account.balance_in.created without trade.reason.

account.credit_in.created covers credit set by CreditIn, CreditInSync or a plugin. Credit has no approval step, and removing credit does not raise a trigger. It has no server actions. Its conditions are those of account.balance_out.created. Credit sources do not set reason, so a rule tells a manual credit from a plugin credit only by trade.comment.

All three offer provider actions with the TRADE payload type, such as mailer.send_template. Their call carries the module event of the same name in its event block — one shape for all three (amount, always positive, order, comment, reason, cashier_transaction_id, occurred_at), so one template serves any of them — see Workflow provider actions and account.credit_in.created. The server publishes the same events to modules on every applied operation without a rule.

customer.converted_to_client starts when an existing lead becomes a client — by MngConvertLeadToClient, MngConvertLeadsToClientsByFilter or the customer.convert_lead_to_client action. It has scope 0, payload type 3 and entity type customer. A customer created as a client does not start it; that is customer.created. It exposes the actions of customer.created except the two conversion actions, and the conditions of customer.created except customer.kind and customer.created_by_import. See Lead converted to client.