# Get Last completed result

**URL:** https://community.temporal.io/t/get-last-completed-result/9370
**Category:** Community Support
**Tags:** python-sdk
**Created:** [September 3, 2023, 2:56pm UTC](https://community.temporal.io/t/get-last-completed-result/9370 "2023-09-03T14:56:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![arttii](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@arttii](https://community.temporal.io/u/arttii)
#### Post date: [September 3, 2023, 2:56pm UTC](https://community.temporal.io/t/get-last-completed-result/9370/1 "2023-09-03T14:56:08Z")

</div>

Hi,

I cannot seem to figure out how to get the last completed result for a Schedule workflow in the python SDK.

Does anyone have a pointer on how to do that?

I primarily want to get the time the workflow ran last time.

Thanks!

---

<div class="post-metadata">

### Author: ![taonic](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/taonic/32/5556_2.png) [@taonic](https://community.temporal.io/u/taonic)
#### Post date: [September 4, 2023, 1:24am UTC](https://community.temporal.io/t/get-last-completed-result/9370/2 "2023-09-04T01:24:22Z")

</div>

> I primarily want to get the time the workflow ran last time.

You can get the last start\_workflow timestamp from `ScheduleActionResult`: [https://github.com/temporalio/api/blob/master/temporal/api/schedule/v1/message.proto#L332-L333](https://github.com/temporalio/api/blob/master/temporal/api/schedule/v1/message.proto#L332-L333)

From Python SDK (modified from [samples-python](https://github.com/temporalio/samples-python/blob/main/schedules/describe_schedule.py)):

```python
async def main():
    client = await Client.connect("localhost:7233")
    handle = client.get_schedule_handle(
        "workflow-schedule-id",
    )

    desc = await handle.describe()

    print(f"Last action: {desc.info.recent_actions[-1]}")

```

Output:

```auto
Last action: ScheduleActionResult(scheduled_at=datetime.datetime(2023, 9, 4, 1, 14, tzinfo=datetime.timezone.utc), started_at=datetime.datetime(2023, 9, 4, 1, 14, 0, 39888, tzinfo=datetime.timezone.utc), action=ScheduleActionExecutionStartWorkflow(workflow_id='schedules-workflow-id-2023-09-04T01:14:00Z', first_execution_run_id='585b8221-3830-4a72-ab18-67e305f9d285'))

```

If you want to get internal state from a completed workflow use Workflow Query.

---

<div class="post-metadata">

### Author: ![arttii](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@arttii](https://community.temporal.io/u/arttii)
#### Post date: [September 4, 2023, 10:50am UTC](https://community.temporal.io/t/get-last-completed-result/9370/3 "2023-09-04T10:50:45Z")

</div>

Thanks for the reply

Is there a way to do this from inside a running workflow without instantiating another client? Or is this the canonical way?

Thanks!

---

<div class="post-metadata">

### Author: ![Chad\_Retz](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chad_retz/32/1396_2.png) [@Chad\_Retz](https://community.temporal.io/u/Chad_Retz)
#### Post date: [September 4, 2023, 1:26pm UTC](https://community.temporal.io/t/get-last-completed-result/9370/4 "2023-09-04T13:26:22Z")

</div>

Temporal client calls (or any other networked client calls) cannot be done from inside a workflow, and we do not have primitives for accessing schedules from inside a workflow. You can do this in an activity. You don’t have to instantiate another client, just set your client as class state and access via an activity method on the class (like [this example](https://github.com/temporalio/samples-python/blob/main/hello/hello_activity_method.py)).

---

<div class="post-metadata">

### Author: ![arttii](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@arttii](https://community.temporal.io/u/arttii)
#### Post date: [September 4, 2023, 3:36pm UTC](https://community.temporal.io/t/get-last-completed-result/9370/5 "2023-09-04T15:36:42Z")

</div>

Perfect, thanks so much for the tips!
