
Accounts BalanceThresholdTrigger
CertifiedTrigger execution on Mercury balance threshold
Accounts BalanceThresholdTrigger
Trigger execution on Mercury balance threshold
Periodically polls Mercury bank account balances and triggers an execution when an account drops below a configured minimum threshold.
type: io.kestra.plugin.mercury.accounts.BalanceThresholdTriggerExamples
Trigger flow execution when any Mercury account drops below minimum balance
id: trigger_mercury_balance_threshold
namespace: company.team
tasks:
- id: alert_low_balance
type: io.kestra.plugin.core.log.Log
message: "Account {{ trigger.account.name }} ({{ trigger.account.id }}) has balance {{ trigger.balance }}, {{ trigger.size }} account(s) below threshold"
triggers:
- id: watch_balance
type: io.kestra.plugin.mercury.accounts.BalanceThresholdTrigger
apiToken: "{{ secret('MERCURY_API_TOKEN') }}"
minBalance: 5000.00
Trigger flow execution when a specific Mercury account drops below minimum balance
id: trigger_mercury_account_balance
namespace: company.team
tasks:
- id: alert_account_balance
type: io.kestra.plugin.core.log.Log
message: "Account {{ trigger.account.id }} balance {{ trigger.balance }} below {{ trigger.account.minBalance }}"
triggers:
- id: watch_specific_account
type: io.kestra.plugin.mercury.accounts.BalanceThresholdTrigger
apiToken: "{{ secret('MERCURY_API_TOKEN') }}"
accountId: "d0e567d8-76a7-11e9-a22d-0b33e9de0755"
minBalance: 10000.00
balanceType: AVAILABLE
Installation
Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:
kestractl plugins get io.kestra.plugin:plugin-mercury --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.
Properties
apiToken *string
Mercury API token
API token for authentication with the Mercury API.
minBalance *numberstring
Minimum balance threshold
The minimum balance threshold in USD. When an account's balance drops below this amount, the trigger fires.
accountId string
Account ID
Optional unique identifier (UUID) of a specific Mercury account to monitor. When omitted, all active Mercury accounts are evaluated.
allowConcurrent boolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
balanceType string
AVAILABLEAVAILABLECURRENTBalance type to evaluate
The balance type to compare against the threshold: AVAILABLE or CURRENT. Default is AVAILABLE.
baseUrl string
https://api.mercury.com/api/v1Mercury API base URL
Base URL for the Mercury API. Override for the Mercury sandbox (https://api-sandbox.mercury.com/api/v1). Must use HTTPS, except for loopback hosts (localhost, 127.0.0.1, ::1) during local testing.
interval string
PT5MdurationPolling interval
The interval between consecutive polls. Default is PT5M (5 minutes).
pageCap integerstring
100Maximum pages to retrieve
Safety cap on the number of pages fetched when listing all accounts. Minimum 1. Default is 100.
stopAfter array
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
when string
trueA condition that determines whether the trigger should run.
A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.
Outputs
account
First account below threshold
The first account that newly dropped below the threshold. Use accounts when several accounts crossed in the same poll.
io.kestra.plugin.mercury.accounts.BalanceThresholdTrigger-AccountAlert
Account balance
The balance of the account evaluated against the threshold.
Account ID
The unique identifier (UUID) of the Mercury account.
Minimum balance threshold
The configured minimum balance threshold in USD.
Account name
The name of the Mercury account.
accounts array
Accounts below threshold
List of accounts that have newly dropped below the minimum balance threshold.
io.kestra.plugin.mercury.accounts.BalanceThresholdTrigger-AccountAlert
Account balance
The balance of the account evaluated against the threshold.
Account ID
The unique identifier (UUID) of the Mercury account.
Minimum balance threshold
The configured minimum balance threshold in USD.
Account name
The name of the Mercury account.
balance number
Balance of the first account below threshold
The evaluated balance of the account exposed in account.
size integer
Number of accounts below threshold
The count of accounts that have newly dropped below the minimum balance threshold.