Delete jobs automatically after successful execution

Hi,
I am executing a workflow in the server via rest api in two steps:

  1. Create job using :jobs?timeout=-1&asyncLoading=false
  2. Execute job using http:///rest/v4/jobs/<job_id>?async=true

But the jobs executed this way are not deleting automatically after successful execution.
How can execute the jobs this was and delete all successful jobs after execution automatically.

Regards
Nithin

You can shift to just calling the workflow execution endpoint which does that exactly.

We have changed this behavior over the years to allow customer who need/want to persist the executed jobs, and those who wish the job to be deleted automatically.

Hope this helps.

Jeff

4 Likes

HI Jeff,

Thank you for the answer. I don’t want to use :execution endpoint, because I want to make the rest call asynchronous, like fire and forget. I don’t want the calling component waint until the execution is over. That is why I am using 2 step execution of the workflow.

Is there any other way to achive automatic deletion of successful jobs?

Regards,
Nithin