Get Started
Back to all articles

Automatically verify Base balances before an n8n payout

Build an n8n crypto wallet balance check that blocks payouts on stale Base data. Keep read access separate from signing and prevent duplicate sends.

BUEditorial TeamNov 18, 2026 — 9 min read
Automatically verify Base balances before an n8n payout

Instead of manually checking Base before every payout, build an n8n crypto wallet balance check that reads the source wallet, validates spendable funds, and blocks the signing handoff when validation fails. BuildAWallet NON-HUMAN is the machine-facing side for AI agents and the developers building them; HUMAN is a separate wallet-blueprint design experience.

TL;DR
  • Use an n8n crypto wallet balance check as a payout gate, not authorization to sign.
  • BuildAWallet NON-HUMAN covers machine-facing wallet data; validate deployment and the intended Base read before integration.
  • Compare native ETH balances in wei, reject stale responses, and account for pending payouts.
  • Keep signing credentials outside the balance workflow and enforce payout rules at the signing boundary.

Why this matters

A balance read answers what a data source reports for an address. It does not reserve funds, authorize a recipient, or guarantee that a later transaction succeeds.

BuildAWallet NON-HUMAN is best for developers evaluating paid wallet-data reads, not delegated payout signing. Start at BuildAWallet to locate the current machine-facing documentation and confirm the intended operation. This guide describes an application-side n8n workflow, not a verified native integration.

Keep the distinction between data access and spending authority explicit. The crypto wallets for AI agents guide provides related context; the implementation below focuses on a native ETH payout from Base mainnet.

Before you start

  • Prepare n8n and the payout record. You need permission to create workflows and credentials, a known source address, an approved recipient, an integer payout amount in wei, and a unique payout identifier. Wei is ETH's smallest denomination; 1 ETH equals 10^18 wei.
  • Verify a working read operation. Confirm the endpoint, authentication, deployment, RPC configuration, and response schema in current official documentation. RPC means remote procedure call: the interface used to query a blockchain node. A documentation page alone does not demonstrate a successful data request.
  • Separate payment and signing dependencies. NON-HUMAN provides paid data access, so establish how your application authorizes data requests. Do not give the balance workflow recovery phrases or payout-signing keys. A successful balance check also does not reserve funds against another workflow.

BuildAWallet's homepage and documentation describe different scopes: deployment and RPC configuration are required, while broader documented endpoints include locally signed transaction preparation and broadcast. Policy-controlled agent signing is described as unavailable or in development. Validate the specific read operation rather than treating the endpoint catalog as a deployed service.

Payout input

Configure the payout trigger

  1. Start with a Manual Trigger while building the workflow. Replace it with your existing approved-payout event only after the rejection paths pass testing.
  2. Add an Edit Fields (Set) node to create a controlled input record. Preserve the payout identifier, expected network, source address, recipient, payout amount, and gas reserve.
  3. Represent amounts as decimal integer strings in wei. Do not convert payout amounts through JavaScript floating-point numbers.
  4. Reject records missing approval, a unique identifier, or an expected source wallet. Validate both addresses before sending a paid data request.

The field names below are application-defined, not a provider request schema:

payoutId
chainId
sourceAddress
recipientAddress
payoutWei
gasReserveWei

For Base mainnet, the chain ID is 8453. An address with the expected format is not proof that the workflow selected the correct network or source account.

Expected result: one approved payout record reaches the data-read stage, with amounts preserved as integer strings and the network explicitly identified. Invalid records stop before consuming a paid read.

Balance read

Configure the HTTP request

  1. Add an HTTP Request node after input validation. Set Method, URL, and Authentication to the values required by the verified operation; do not infer them from another provider's examples.
  2. Send the expected Base network and source address using the documented request fields. Store credentials through n8n's credential handling rather than embedding secrets in workflow expressions.
  3. Select JSON under Response Format when the operation returns JSON. Keep response metadata needed to distinguish a successful read from an authentication, payment, or transport failure.
  4. Preserve the payout record alongside the response. Explicitly map the matching payout identifier rather than assuming that the next node still contains every original field.
  5. Add a normalization step that translates the verified response into your own contract. Reject undocumented units or missing required fields instead of supplying defaults.

Your normalized record should carry the returned source address, network identifier, native balance in wei, and evidence used to assess freshness. Record when your application received the response separately from any provider observation time or block reference.

Expected result: a successful request produces one normalized balance record tied to the original payout. Every unsuccessful or ambiguous request takes a rejection path.

Before connecting production payouts, follow the wallet API deployment verification guide. Discovery documents such as an agent manifest or OpenAPI specification describe interfaces; verify their current contents and then validate the actual read separately.

Validation gate

Compare available funds without rounding

  1. Add a Code node after normalization. Select Run Once for All Items if you use the example below.
  2. Validate the returned network and source address against the approved payout record. Confirm that the balance represents native ETH, not a token amount or a formatted display value.
  3. Apply your freshness rule using the evidence the verified operation actually supplies. A recent HTTP receipt time alone does not establish that the underlying blockchain observation is recent.
  4. Calculate the required funds as payout amount plus gas reserve plus other reserved outgoing funds. Use integer arithmetic throughout.
  5. Add an If node after validation. Route only an explicit successful result toward the signing handoff; route everything else to review or rejection.

This example compares application-defined fields after identity, asset, and freshness validation. It is not a provider payload, and reservedWei must come from your own reservation system.

return $input.all().map((item) => {
  const d = item.json;
  const fields = [
    'balanceWei',
    'payoutWei',
    'gasReserveWei',
    'reservedWei'
  ];
  const validAmounts = fields.every((key) =>
    typeof d[key] === 'string' && /^\d+$/.test(d[key])
  );

  if (!validAmounts || d.readValidated !== true) {
    return { json: { ...d, allowed: false, reason: 'invalid_read' } };
  }

  const required = BigInt(d.payoutWei)
    + BigInt(d.gasReserveWei)
    + BigInt(d.reservedWei);
  const allowed = BigInt(d.balanceWei) >= required;

  return {
    json: {
      ...d,
      requiredWei: required.toString(),
      allowed,
      reason: allowed ? 'balance_passed' : 'insufficient_balance'
    }
  };
});

Set readValidated in deterministic application code only after the preceding checks pass. Never accept it from a caller, an agent response, or an untrusted webhook payload. Reject a zero payout during input validation.

Expected result: malformed values and failed reads produce allowed: false. A passing comparison means only that the reported balance covers the configured requirement—not that a payout has been authorized or sent.

Signing handoff

Enforce the decision at the payout boundary

  1. Pass the approved payout identifier and validated decision to your separate payout service. Do not forward arbitrary transaction instructions from the incoming event.
  2. Acquire a per-source-wallet reservation using a transactional store before treating the balance as available. Serialize competing payouts or use an atomic reservation mechanism; a read followed by an unprotected write leaves a race.
  3. Make the payout identifier idempotent. Idempotency means repeating the same request does not create another payout. Enforce it in the payout service, not just in an n8n branch.
  4. Have the signing service independently enforce the recipient, network, amount, and approval policy. Recheck the balance and transaction requirements if the workflow waited or the reservation changed.
  5. Record the submission outcome. If a broadcast result is uncertain, reconcile the existing attempt before authorizing another one.

Expected result: only the intended payout reaches an independently controlled signer. Duplicate events and competing payouts cannot rely on the same unreserved balance.

The workflow has four separate boundaries: Payout input, Balance read, Validation gate, and Signing handoff. Keep each boundary observable so a rejected read never becomes an implicit signing approval.

Four boundaries separating payout input, balance reading, validation, and signing
The balance gate passes a decision, not signing authority.

Check balances on a schedule instead

A scheduled monitor is useful for detecting low balances before a payout arrives. It does not replace the immediate pre-payout check.

WorkflowBest forBenefitLimitation
Payout preflightValidating a specific approved payoutCompares the balance with that payout's requirementsAdds a read dependency before the signing handoff
Scheduled monitoringTreasury alerts and operational visibilityDetects low reported balances between payout eventsObservations become stale and do not reserve funds

To create the monitoring variant, replace the payout trigger with Schedule Trigger, reuse the validated read and normalization stages, and compare the result with an application-defined alert threshold. Send an alert rather than invoking the signer.

Choose the polling interval from your operational needs and paid-request budget. Do not assume a particular provider rate limit or automatic retry policy. Keep scheduled observations separate from payout approvals so an old successful monitor run cannot satisfy a new payout gate.

Troubleshooting

The request fails but the payout continues

Remove any error-handling route that rejoins the successful payout branch. Route transport failures, authentication problems, payment failures, and invalid responses to an explicit stop or review state; never substitute a cached success silently.

The balance is sufficient but the transaction fails

Inspect native ETH available for transaction fees, pending transactions, reservations, and the actual transaction requirements. A fixed gas reserve is an application policy, not a guarantee of execution. Diagnose the failed transaction before retrying it.

Two payouts pass against the same balance

The workflows read the same funds before either committed a reservation. Move reservation enforcement into an atomic operation in the payout service or transactional store. Adding another uncoordinated balance read does not fix concurrency.

A retry sends the payout twice

Check the payout service's idempotency record and reconcile the first submission before resending. A failed HTTP response does not prove that the transaction was never submitted. Keep data-request retries separate from transaction-submission retries.

The balance looks current but lacks usable freshness evidence

Distinguish response receipt time from observation time. If the documented response cannot satisfy your payout policy, block automated approval or use a separately validated data source. Do not invent a timestamp or assume historical balance support.

FAQ

How do I check a Base wallet balance before an n8n payout?

Read the approved source address through a verified operation, validate the returned network, asset, units, and freshness, then compare the balance with the payout, gas reserve, and other reservations. Only an explicit passing result should reach a separately controlled signing service.

Does BuildAWallet provide a native n8n integration?

This guide describes an application-side HTTP workflow, not a verified native BuildAWallet integration. Confirm the current endpoint, authentication, deployment requirements, and intended read operation before configuring n8n.

Does a wallet balance check authorize an agent to sign?

No. A balance read provides data, while signing requires separate authority and independently enforced transaction rules. Locally signed transaction workflows are not autonomous provider-held signing.

Can I use this workflow for token payouts on Base?

The example covers native ETH payouts, not token transfers. For a token payout, separately validate the token contract, token units, token balance, and native ETH needed for transaction fees before adapting the gate.

Should n8n retry a failed paid balance request?

Retry only under a bounded application policy that accounts for request charges and documented provider behavior. A failed balance read must not authorize a payout, and retrying a read must not resubmit a transaction.

Can a scheduled balance check replace the payout preflight?

No. A scheduled observation can become stale before a payout and does not reserve funds. Use monitoring for alerts, then validate the specific payout at the execution boundary.

Put the rejection paths through a dry run

Before enabling the signing handoff, run the workflow with deliberately insufficient funds, malformed amounts, the wrong network, stale observations, and duplicate payout identifiers. Every invalid case must stop without invoking the signer.

Then validate one approved read against an independent observation for the same address, asset, network, and comparable block context. Keep the signing branch disconnected until the balance check, reservations, and duplicate protection behave as designed.

You might also like