Skip to content

MngGetWorkflowActionsByTrigger

Returns action definitions allowed for a selected workflow trigger.

Access

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

Request Parameters

Name Type Required Description
trigger string Yes Trigger code, for example deposit.created

Request

{
  "command": "MngGetWorkflowActionsByTrigger",
  "extID": "1",
  "data": {
    "trigger": "deposit.created"
  }
}

Response Data

{
  "rows": [
    {
      "code": "kyc.require_step",
      "scope": 0,
      "side_effect_level": 2,
      "supported_payload_types": [1, 3, 5],
      "requires_account": 0,
      "requires_customer": 1,
      "requires_kyc": 1,
      "requires_lead": 0,
      "required_params": ["step_code", "level"],
      "optional_params": ["reason"],
      "recommended_conditions": ["amount_usd", "customer.kyc_current_level"]
    }
  ]
}

recommended_conditions is a UI hint. Backend validation does not require these fields.

Provider actions

Actions registered by Moleculer modules (Workflow provider actions) follow the server actions, sorted by code. They have the same fields plus:

Name Type Description
provider string Moleculer service that registered the action
label string Caption from the manifest
description string Description from the manifest
param_definitions array Parameter descriptions; required_params and optional_params are derived from them

Parameter description:

Name Type Description
name string Parameter name
label string Caption
type string int, double, string or bool
required bool Whether the rule must set it
default value Present when declared; sent to the provider when the rule omits the parameter
enum_values array Present when declared: [{"value": ..., "label": ...}]
min, max number Present when declared
max_length int Present when declared
options_source object Present when declared: the command that returns the choices (command), the row field for the value (value_key) and for the caption (label_key), and filter_by_rule_brand — keep only rows of the rule brand

The fields are absent for server actions. A provider action disappears from the list while its provider is offline.

{
  "rows": [
    {
      "code": "mailer.send_template",
      "scope": 2,
      "side_effect_level": 0,
      "supported_payload_types": [1, 3, 5, 7, 8],
      "requires_account": 0,
      "requires_customer": 1,
      "requires_kyc": 0,
      "requires_lead": 0,
      "required_params": ["template"],
      "optional_params": ["fallback_template"],
      "recommended_conditions": [],
      "provider": "sct-mailer",
      "label": "Send email template",
      "description": "Send the customer an email built from a mailer template",
      "param_definitions": [
        {
          "name": "template",
          "label": "Template",
          "type": "int",
          "required": true,
          "min": 1,
          "options_source": { "command": "MailerGetTemplates", "value_key": "id", "label_key": "name", "filter_by_rule_brand": true }
        },
        {
          "name": "fallback_template",
          "label": "Fallback template",
          "type": "int",
          "required": false,
          "min": 1,
          "options_source": { "command": "MailerGetTemplates", "value_key": "id", "label_key": "name", "filter_by_rule_brand": true }
        }
      ]
    }
  ]
}

customer.set_lifecycle_flags

Raises and clears milestone bits on the linked customer. It replaces the removed customer.set_lifecycle_stage.

Name Type Required Description
add int64 No Bits to raise, 0..63
remove int64 No Bits to clear, 0..63

Both parameters are listed as optional, but at least one must be supplied; the handler enforces that. Flag values are listed in Lifecycle Flags.

{
  "type": "customer.set_lifecycle_flags",
  "params": {
    "add": 8,
    "remove": 32
  }
}

account.open

The customer.created and customer.converted_to_client triggers expose the restricted CRM action account.open. It separates customer intake from account provisioning.

Name Type Required Description
group string Yes Enabled trading group belonging to the customer's brand
leverage int No Positive leverage override; the group default is used when omitted
{
  "type": "account.open",
  "params": {
    "group": "DEMO_EU",
    "leverage": 100
  }
}

The action is idempotent for a customer and group: if that customer already has an account in the target group, the action succeeds without creating another one. New accounts receive a generated password and require a subsequent password change. If the target group has default_deposit > 0, a newly created account receives that amount through the standard OP_BALANCE_IN finance path with the Default balance comment. An already existing account does not receive another default deposit.

For affiliate-specific rules, customer.created also exposes customer.affiliate_id, customer.campaign, and customer.source_type as conditions.

bonus.grant

The deposit.created trigger exposes the restricted bonus.grant action. It creates a new OP_BONUS_IN operation through the platform finance core after all rule conditions have matched.

Parameters:

Name Type Required Description
mode string Yes fixed or percent
value number Yes Fixed bonus in account currency, or percentage of the source balance-in amount
max_amount number No Positive cap in account currency, primarily for percentage rules
comment string No Finance operation comment, maximum 256 characters

Percentage example:

{
  "type": "bonus.grant",
  "params": {
    "mode": "percent",
    "value": 20,
    "max_amount": 500,
    "comment": "20% deposit campaign"
  }
}

Fixed example:

{
  "type": "bonus.grant",
  "params": {
    "mode": "fixed",
    "value": 100
  }
}

The generated bonus operation has reason TR_REASON_BONUS_GRANT, references the source balance order through parent_order, and uses a deterministic identifier based on the workflow rule and balance order. Reprocessing the same source event for the same rule therefore does not enqueue a second bonus. TR_REASON_BONUS_CONVERSION balance-in records are rejected by this action. A rule may contain no more than one bonus.grant action; separate promotions must use separate rules.