Passing parameters to task

Hey All,

So, I have a task, whose sole purpose is to log requests to DynamoDB. I want to log every task, provisions, and erroneous workflows alike.

In order to do this, I’ve written a custom Golang service to allow me to send HTTP requests to it, which puts those into the DynamoDB tables. Here is where my question comes in:

I want to basically write one task (one bash content / local) that I can use in all of those various workflows. In order to keep track of what the task is, there is a requesttype parameter. So, for a new build it might look like:

curl -d 'requesttype=New_Build'

Now, I would want to replace New_Build with whatever the workflow is meant to do, but using the same task. Is this feasible, or will I have to make a new task for each workflow to log what it does?

1 Like

Alright, how about this, is there a way to get the name of the running workflow?

Hey there! I can’t specifically answer your question from the generic task perspective, I’m a bit rusty TBH.

But, this application could do what you need, and save you needing to set up the “task” on each workflow too.

It’s set up to send webhook style calls on monitored events - workflows included. If you can adapt your Go service to handle the hook POST request body you may be in business. Or fork the Dozer code and modify that - it is also written in Go.

There’s a video demo on this page : - Dozer, Webhooks for Morpheus

I appreciate that, and have checked it out. Unfortunately, a whole lot of the workflows and tasks don’t seem to populate the mysql database with task_name. I’m not sure what in Morpheus decides to populate or not populate task_name, but I would need to ensure those get populated in order to use Dozer in the way needed.

1 Like