-- KEYS[1]: the task data hash
-- KEYS[2]: the metadata prefix (e.g. "task_meta")
-- ARGV[1]: the task ID
-- Returns: { [task_data_array], [metadata_array] }
local task_id = ARGV
if not task_id
-- Get the task data
local task_data = redis.
if not task_data or not task_data
-- Build metadata array
local meta_key = KEYS .. ":" .. task_id
local fields = redis.
-- Prepend the task_id for consistent format
table.
return