Skip to main content

Can you update the API call to enable us to see who ran a job? I am trying to better support my users but I would like to be able to include the user that ran the automation into  an email that I receive when a job fails.

@gboquin depending on how you have your workflow setup to send the email, you can leverage the Flow REST API endpoint that supplies this information.

 

In the V4 Flow API, the /jobs endpoint will return runtimeUserName. You can apply sourceType=automations to help filter the results or use sourceID=<Automation UID> for the specific Automation. The Job id is also returned to help with filtering the response if that is available to you.

In the V3 Flow API, /transformations/jobs/completed will provide the same information (and filtering options), though the value is more difficult to parse as runtimeUserName is nested in the response—see documentation for details. An example snippet is below:

"request": {

        "NMDirectives": {

          "directives":

            { "name": "input_notification",

              "value": "{\"source\":\"schedule\",\"time\":\"2024-04-01T17:53:58Z\",\"runtimeUserName\”:\”<username>\”}”

 

It is definitely easier when using the V4 /jobs endpoint! I’m not sure if it is feasible in your current workflow—so any more information how you are constructing the email body could be helpful.

Hope this helps.


NewOpen