-- A task pins its workflow definition when it first runs, so parked and queued -- tasks keep the "identity: root" that 0053 removed from the stored definitions -- and fail to resolve it on every retry. The digest is the pin's SHA-256. -- +goose Up UPDATE tasks SET workflow_definition_yaml = regexp_replace(workflow_definition_yaml, 'identity: root(?=\n|$)', 'identity: 6f129e29-0e26-5246-99bd-74cb4496203b', 'g'), workflow_definition_digest = encode(sha256(convert_to(regexp_replace(workflow_definition_yaml, 'identity: root(?=\n|$)', 'identity: 6f129e29-0e26-5246-99bd-74cb4496203b', 'g'), 'UTF8')), 'hex') WHERE status IN ('parked', 'queued') AND workflow_definition_yaml ~ 'identity: root(\n|$)'; -- +goose Down SELECT 1;