--- 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. menu: flux_v0_ref: name: tasks.lastSuccess parent: influxdata/influxdb/tasks identifier: influxdata/influxdb/tasks/lastSuccess weight: 301 --- `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 ``` {{% caption %}} For more information, see [Function type signatures](/flux/v0/function-type-signatures/). {{% /caption %}} ## Parameters ### orTime ({{< req >}}) 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) ```