Question: How can I get the current history ID from a workflow step
2
gravatar for Doug King
3.5 years ago by
Doug King20
United States
Doug King20 wrote:

I am looking for a way to get the current history ID from a workflow step. 

I am building a tool that will be part of a workflow. This tool will parse a VCF and save some bits to a database. We want to be able to get the ID of the history and save it to the database as well so we can link back to it when the job is complete. I don't see any easy way to pass the 'current' history to the command line tool using workflow wrapper attributes. I am looking at using blend4j as a way to get at the history but don't know if that is do-able or appropriate in this situation. I would think there would be some sort of ID that is passed in workflow steps, or a global value that is easy for a workflow step to access that will get the history we are running under.

Does anyone know how to get an ID of a workflow execution (history) while it is running?

Thanks,

Doug

 

 

galaxy • 1.3k views
ADD COMMENTlink modified 3.5 years ago by jmchilton1.1k • written 3.5 years ago by Doug King20
2
gravatar for jmchilton
3.5 years ago by
jmchilton1.1k
United States
jmchilton1.1k wrote:

Doug - 

 I think this is a great idea and would be a useful feature. I tried to add something along these lines in the past and was unjustly thwarted - https://bitbucket.org/galaxy/galaxy-central/pull-request/473/allow-tools-to-access-__history_name__/diff. That should give you some idea how to implement this if you want to make local modifications - you could inject and id the same way that is injecting a name. If one were to open a PR to add this to the core Galaxy I would of course +1 it but I am not sure it wouldn't be shot down the same way.

Many use cases where you are tracking sample information by sending a whole sample to its own history for a workfow - can be replaced by data collections - bit.ly/gcc2014workflows http://planemo.readthedocs.org/en/latest/writing_standalone.html#collections. Dataset collections are relatively experimental still - but offer more power to tool developers.

-John

ADD COMMENTlink written 3.5 years ago by jmchilton1.1k

Thanks John, your PR is close to what I was hoping for. Interesting to read comments as to why your PR was turned down. I am new to Galaxy and the philosophy it embodies so I am not sure how to take those comments in the PR. On the one hand I think we have a viable use-case. We want another system to be able to link back to the history so users of that system can check status (is it still running?), etc.

One way to do this would be to have a GUID that is generated for a history and captured in the tool context data at the start of a workflow. I do see a way to publish a history that might get me close to a solution, but I'm not sure if I could create a history, publish it and then start the workflow programmatically (using Blend API), capture the published history ID and save it to an external DB or webservice.

Perhaps there are other ways of accomplishing this or good reasons why not to do it.

ADD REPLYlink written 3.5 years ago by Doug King20
1
gravatar for jmchilton
3.5 years ago by
jmchilton1.1k
United States
jmchilton1.1k wrote:

Hey Doug - 

There was a parallel conversation happening here (http://dev.list.galaxyproject.org/find-UUID-of-current-history-in-tool-XML-wrapper-td4667113.html). I think the following idiom can be used to get a history id that can be used with bioblend or blend4j -  without needing to apply the changes from the previously linked PR.

-John

ADD COMMENTlink written 3.5 years ago by jmchilton1.1k

Thank John for moving this forward.

For anyone interested, the thread on the dev list has good answers to the question of Galaxy's stateless workflow philosophy and how to get a history id for a tool in a workflow step.

http://dev.list.galaxyproject.org/find-UUID-of-current-history-in-tool-XML-wrapper-td4667113.html

ADD REPLYlink written 3.5 years ago by Doug King20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 88 users visited in the last hour