---
title: tasks.lastSuccess() function
description: tasks.lastSuccess() returns the time of the last successful run of the InfluxDB task or the value of the orTime parameter if the task has never successfully run.
url: https://docs.influxdata.com/flux/v0/stdlib/influxdata/influxdb/tasks/lastsuccess/
estimated_tokens: 162
product: Flux
version: v0
publisher: InfluxData
canonical: https://docs.influxdata.com/flux/v0/stdlib/influxdata/influxdb/tasks/lastsuccess/
date: '2024-04-08T16:01:02-06:00'
lastmod: '2024-04-08T16:01:02-06:00'
---

* Flux 0.84.0+

InfluxDB support

`tasks.lastSuccess()` returns the time of the last successful run of the InfluxDB task
or the value of the `orTime` parameter if the task has never successfully run.

##### Function type signature

```js
(orTime: A) => time where A: Timeable
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### orTime

(Required)
Default time value returned if the task has never successfully run.

## Examples

### Return the time an InfluxDB task last successfully ran

```js
import "influxdata/influxdb/tasks"

tasks.lastSuccess(orTime: 2020-01-01T00:00:00Z)
```
