claim lock
This block is part of the locking group and was last modified in core v15.0.0.
claim lock v12.0.4 Updated v15.0.0Tries to claim a lock and returns if it was successful or not
- flow
- key
valuerequired - expiry (sec.)
numberExpiry in seconds to claim this lock.
- auto clear
conditionv15.0.0Release this lock automatically when the flow ends : no separate free lock block needed.
- flow
- success
condition - error
value
Attempts to claim the lock via Redis SET NX: condition=true when this run created the key, condition=false with error value "Could not claim lock" when it is already held, or "Could not find lock to claim" when the key input is falsy. The lock expires after expiry seconds (default 60; zero, negative, or non-numeric values fall back to 60), and when auto_clear is truthy it is also released automatically when the run ends : for a block inside a called function or an iterator callback, that is when the outermost calling flow ends, never when the function returns.
A typical wiring for claim lock: branch feeds the flow pin; concatenate values feeds the key pin; number feeds the expiry pin; the flow out pin feeds branch.
Commonly used with
In production blueprints, this block is most often wired together with:
- branch: wired in both directions with this block.
- concatenate values: feeds into this block.
- number: feeds into this block. Generates a valid number from the filled custom value in the blueprint.
- one hour: feeds into this block. Returns one hour in seconds as a number.
Used in these guides
These documentation pages use or explain this block:
Version history
Introduced in v12.0.4.
Last modified in v15.0.0.
Back to
locking Return to the main group to view all sub-groups Back to locking Return to the group to view all blocks within this group 