action_code
(see Creating Triggers). For flows that need a
contract, a deploy step, and an off-chain client, see the
full demos.
1. Echo a webhook payload
The simplest trigger action — returns what it received. Useful to confirm a webhook is wired up and to see the exactparams shape.
POST /webhook/<id> with any JSON body —
the body comes back under event, and the safe request headers under
header_keys.
2. Notarize a payload with a keyless signature
Take any webhook payload, compute a deterministic digest, and sign it with the action’s own wallet — a key held by the Lit network, not by any server. The result is a tamper-evident receipt that only this exact action code could have produced. This is the building block the on-chain demos extend.recovered with the action’s address that you looked up yourself, not only with the signer field in the receipt. Anyone can write any address into that field. Get the address of this CID from Lit with Lit.Actions.getLitActionWalletAddress({ ipfsId }) in another action, as Patterns describes, and pin it in your verifier.
3. Sign a scheduled heartbeat
A schedule trigger that signs a timestamped heartbeat each tick — a minimal “signed cron” you can post on-chain or to an external monitor.4. React to a chain event
A chain-event trigger that reads ABI-decoded args from a matched log. Pair theTransfer(address,address,uint256) signature with an ERC-20 contract to watch
transfers; decoded.arg2 is the amount.
Full demos
These need more than one file to run — a Solidity contract, a deploy script, an end-to-end client — and live underexamples/lit-triggers/ in the repo:
Each ships a hardened action, a one-shot
setup script (action CID, scoped key,
contract deploy where applicable, trigger creation), and an end-to-end client.
(uptime-insurance has no contract — its “pool” is the action wallet’s balance.)