Skip to content

How to provide task parameters dynamically #681

Answered by pavilalopes
pavilalopes asked this question in Q&A

You must be logged in to vote

The download sample just has static parameters, but I took inspiration from the Mail sample that writes to the timetable.parameter table from inside a task.

So I created a test chain where the second task is a CopyToFile, and the first task is an SQL that updates the second task's parameters, like this:

update timetable.parameter
set value = jsonb_set(value, '{filename}', ('"/tmp/export ' || LOCALTIME || '.csv"')::jsonb)
where task_id = (
	select task_id from timetable.task
	where chain_id = current_setting('pg_timetable.current_chain_id')::bigint and task_name = 'export csv'
)

Unfortunately this didn't work. The update itself works fine, but the updated parameters are not picked up. The…

Replies: 2 comments 3 replies

You must be logged in to vote
1 reply
@pashagolub

You must be logged in to vote
2 replies
@pashagolub

@pavilalopes

Answer selected by pavilalopes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants