
Kestra Plugin Acquire
CertifiedAcquire a lock on an asset for the duration of the execution
Kestra Plugin Acquire
Acquire a lock on an asset for the duration of the execution
Acquires an EXECUTION-owned lock on the asset on behalf of the current execution, so concurrent flow writes to the asset are rejected while it is held. The lock is released by the Release task, or automatically when its ttl expires. The calling credential must hold the LOCK permission on the ASSET resource (typically a dedicated service account); other principals are rejected with 403.
type: io.kestra.plugin.kestra.ee.locks.AcquireExamples
Lock an asset while a flow writes to it, then release it.
id: lock_asset
namespace: company.team
tasks:
- id: acquire
type: io.kestra.plugin.kestra.ee.locks.Acquire
assetId: customers_by_country
ttl: PT1H
- id: write
type: io.kestra.plugin.core.log.Log
message: writing to the locked asset
- id: release
type: io.kestra.plugin.kestra.ee.locks.Release
assetId: customers_by_country
Properties
assetId *Requiredstring
The ID of the asset to lock
auth Non-dynamic
Select API authentication
Use either an API token or HTTP Basic (username/password); do not provide both.
io.kestra.plugin.kestra.AbstractKestraTask-Auth
API token for bearer auth
trueAutomatically retrieve credentials from Kestra's configuration if available
The default configuration can be configured globally inside the Kestra configuration file:
- Set
kestra.tasks.sdk.authentication.api-tokento use an API token - Set
kestra.tasks.sdk.authentication.usernameandkestra.tasks.sdk.authentication.passwordfor HTTP basic authentication - Set
kestra.tasks.sdk.authentication.urlto also default the Kestra API endpoint (seekestraUrlabove) The Enterprise edition also provides setting a default configuration at the Namespace or Tenant level by an administrator. Set to false to also opt out of the default URL.
Password for HTTP Basic auth
Username for HTTP Basic auth
kestraUrl string
Override Kestra API endpoint
URL used for calls to the Kestra API. When null, falls back to the url configured alongside the default SDK authentication (Namespace or Tenant level, Enterprise edition), then renders {{ kestra.url }} from configuration; if still empty, defaults to http://localhost: 8080. Trailing slashes are stripped before use.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
tenantId string
Override target tenant
Tenant identifier applied to API calls; defaults to the current execution tenant.
ttl string
PT5MHow long the lock is held before it expires
An ISO-8601 duration (e.g. PT1H).
Outputs
executionId string
The id of the execution holding the lock
lockedUntil string
date-timeThe instant at which the lock expires
ownerType string
The lock owner type (always EXECUTION for a task-acquired lock)