How to provide task parameters dynamically #681
-
Hi, is there any way to set parameters dynamically for tasks like SendMail and CopyToFile? We're evaluating pg_timetable to replace a bunch of ad-hoc shell scripts. I've been able to replicate everything the scripts are doing in pg_timetable, except this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hello. Yes, you can update For example, here we add new files to download for the task with INSERT INTO timetable.parameter (task_id, order_id, value)
VALUES (1, 1,
'{
"workersnum": 1,
"fileurls": ["https://simplemaps.com/static/data/country-cities/mt/mt.csv"],
"destpath": "."
}'::jsonb),
(1, 2,
'{
"workersnum": 5,
"fileurls": ["https://foo.com/some-big-data.bin"],
"destpath": "."
}'::jsonb); |
Beta Was this translation helpful? Give feedback.
-
The download sample just has static parameters, but I took inspiration from the Mail sample that writes to the 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:
Unfortunately this didn't work. The update itself works fine, but the updated parameters are not picked up. The second task runs with the parameter values as they were before the update. I guess the program is reading the parameters at the start of the chain execution, rather than at the start of the task execution? Anyway this seems to be a dead end. |
Beta Was this translation helpful? Give feedback.
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:
Unfortunately this didn't work. The update itself works fine, but the updated parameters are not picked up. The…