Skip to main content

I’m using the NAC APIs to generate a Report.

The Tasks API v2 is successfully returning all the Tasks for a workflow instances.

However, I just noticed that the Tasks API v2 is returning empty tasks for Instances which were completed 14 days ago.

Question: Does the Tasks Details of a workflow instance expire? If YES, when does it expire

 

Status Response is 200

{
"tasks": "]
}

 

 

Hi @Garrett 

 

Tasks API v2 actions are part of an xtension, it is likely there are issues with that xtension since updates to the API have been made, @Dan_Stoll This is not the first time I have seen issues like this, can we review this xtension?

 

https://gallery.nintex.com/t/NintexWorkflowCloudAPI-v

 

To answer your question, as far as I know instance data including task data is stored for up to 1 year, I believe however this only relates to the data contained in the task, I believe the record of the task its-self is stored indefinitely for the life of the tenant. 

 

For example, If I created a task and responded to that task with the comment ‘Nice job’ that value of ‘Nice job’ is stored (if the workflow is left active) for up to 1 year when the instance for the workflow will expire.

 

The fact that my task existed will remain in the instances however until the data is deleted via the instance or the tenant is deleted.

Hope this helps

Jake 


Hi @Jake 

Thanks for your respond.

 

I would like to clarify that I am using the API directly from PowerShell.

I only provide the TOKEN and the WorkflowInstanceID → All tasks running or completed which are over 2 weeks are not returned ( "tasks": s] )

My previous observation is that completed tasks over 2 weeks are not show.
Now it seems that even running tasks over 2 weeks are not shown.

 

I get the same result when I used the provided Toolset

 

It is weird when even still running tasks (over 2 weeks) are not returned. 
 


Hi @Garrett 

 

Apologies for the misunderstanding.

 

For that API call you have to provide a date range in the call like this:

 


Also keep in mind that using Nintex Analytics for reporting on anything like this is much more efficient unless you need real time, Analytics can surface odata feeds that update regularly with all of this data. 


Thanks @Jake 

omg Its was the date range! 
I only provided the Workflow-Instance-ID. 
Once I provided the from parameter, it works great now

 

The to parameter defaults to current date-time.
The from parameter defaults to 14 days prior to current date-time.


@Garrett 

 

Just to point out, there’s also a 4MB limit on the response return from a single query. We’ve hit the issue before where the List Tasks query doesn’t actually return everything within the specified date range because it hits this limit.  Not that that’s the issue you’re hitting, but it definitely explained inconsistent results we were having when using a larger date range (or no date range). 

 

Nintex Idea here if you’re interested: 

https://ideas.nintex.com/ideas/IDEA-I-2635


Thanks for the info @bsikes - I’m just querying Tasks on a single workflow Instance.

 

Main: Query for all instances in workflow “Garrett Workflow” 
## This has paging ability as the max instances return is 100 items

## Get all of the instances for a workflow named "Garrett Workflow"
## into an Object variable $intances

$instances = NAC API Query

foreach ($instance in $instances) {

## Get all of the tasks for a single instance $instance
## into an Object variable $tasks

foreach ($task in $tasks) {
}

}

 

PS: I up voted for your idea

 


Thanks @Garrett

 

We’ve only noticed the issue in a specific process we have running that’s tracking ALL outstanding tasks across our whole tenant, so I definitely wouldn’t expect you’d see that issue if your using a specific instance id. 


Reply