Repository navigation
Replies: 4 comments 2 replies
|
Hi Daniel! I asked something similar in this issue. Maybe it can help you. https://github.com/pixlcore/xyops/issues/56 If you read stdin in the job, you can get all the json with the complete information. Inside, you have the “workflow” node. In the end, it worked for me to retrieve the stdin when starting the job and do a complete print, so that you have all the information in the job log, and if you format the JSON, you can see all the information you can obtain. I have tested it from a shell script with Python shebang and Deno/TypeScript without any problems. |
|
Okay, so, I see several feature requests in here 😝 First, an oversight on my part. I absolutely meant to pass the Job.now timestamp property down to workflow sub-jobs, but I totally missed it. I will add that in the next release. So what this means is that all your workflow sub-jobs will have access to the top-level Okay, so after re-reading your post again, I'm not entirely sure if you are talking about the built-in Job.now timestamp, OR if you are talking about adding a custom user field with a date/time in it. Let me discuss both options: Using Built-In Job.now:So, running a job with a custom Importantly, if you RE-RUN a job in the UI, the Job.now timestamp will be preserved, i.e. set to the original value when the job first ran. It is never reset to the current time.
Further, you have some additional control over this, meaning you can edit the Catch-Up trigger and use the "Time Machine" feature to re-run jobs in the past:
So if you utilize this feature:
Importantly, there is no way to completely customize the Custom User Date/Time FieldOkay, so from your post:
This sounds like you are using a custom user field to gather a date? Let's assume you are. If so, all you need to do is add the user field to the top-level workflow (not a sub-job), and make it a text field, and set the "variant" to "Date" (or "Date/time" if you want a time too), whichever you prefer:
Now, here is what happens. Any time you run the workflow manually, the user is prompted to enter a date in the run dialog:
You can also set the "Required" checkbox so they MUST enter a date to proceed. But if a job runs via the scheduler, the value will be unset, or set to whatever default date you entered when you defined the field (user fields are never set via the scheduler), so it is up to your code to apply a default value or take a default action (i.e. set to today's date, etc.). Also note that the date & date/time text field variants deliver their values as strings. These come straight out of the HTML spec, so the date field always uses a normalized So this is a workflow-level user field, but its value will be passed down to all the sub-jobs, by way of the JobWorkflow.params object. Meaning, your sub-job code can just read the JSON from STDIN, then access Using a custom user field like this allows you full control over what date is entered. Meaning, the user can enter a future date, and that will be passed to your workflow and sub-jobs. Does this help you at all? I hope between these two options something helps solve your use case. I am releasing xyOps v0.9.36 today, which will have several bug fixes, including the two discussed above. |
|
Tested successfully! Great work. Thank you! |





Uh oh!
There was an error while loading. Please reload this page.
Hi Joe,
I tried to solve my requirement with your documentation but wasn't able to find the needed informations and/or examples.
My requirements:
I need a couple of workflows with multiple steps
these workflows are trigged from the scheduler
the first step gets a specific date (the current date, yesterday or tomorrow, depending of the workflow)
this date must be available to all other event nodes in this flow
if I rerun an executed worflow, the date should be the same as in the initial run - not newly evaluated
the workflow should also be executed manually where I can set the date explicity
how can I fill the output with variables in step 1 which I can read in step 2? Writing some JSON data in the shell script of step 1 doesn't seem to fill up the input dict of step 2.
I can successfully access the date from the manually run step in workflow.params. Can I override this value?
Thanks in advance.
Daniel
All reactions