# Workflow strategy for multiple interactions with the world

**URL:** <https://community.temporal.io/t/workflow-strategy-for-multiple-interactions-with-the-world/6637>\
**Category:** Community Support\
**Created:** [December 2, 2022, 8:43pm UTC](https://community.temporal.io/t/workflow-strategy-for-multiple-interactions-with-the-world/6637 "2022-12-02T20:43:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@nick](https://community.temporal.io/u/nick)\
**Post date:** [December 2, 2022, 8:43pm UTC](https://community.temporal.io/t/workflow-strategy-for-multiple-interactions-with-the-world/6637/1 "2022-12-02T20:43:50Z")

</div>

Hello everyone,

Thanks to all the contributors on this project, you did an amazing job and I am excited to develop my next project using Temporal.

I need some tips & tricks in terms of the best strategies for implementing a workflow that interacts with the world multiple times. The project that I am building should handle the following in a typical workflow:

- Sleep for a predefined amount of time.
- Fetch credentials from a trusted source.
- Check whether the credentials are still valid, if not then notify the system + have a retry mechanism.
- Use the credentials to interact with a different service.

With this system in mind, here are my questions:

- Would each step (except for the sleep) be a separate Activity or would it make sense to handle everything directly from the Workflow?
- How would it be best to handle the errors if a request to an external service fails?

Thank you so much for your time and help!

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [December 2, 2022, 9:07pm UTC](https://community.temporal.io/t/workflow-strategy-for-multiple-interactions-with-the-world/6637/2 "2022-12-02T21:07:03Z")

</div>

> - Would each step (except for the sleep) be a separate Activity or would it make sense to handle everything directly from the Workflow?

Yes, interactions with your credentials provider for fetching/validating certs, and interacting with the different services should be done via activities.

> - How would it be best to handle the errors if a request to an external service fails?

One way would be to poll this service, see forum post [here](https://community.temporal.io/t/what-is-the-best-practice-for-a-polling-activity/328) (associated java code samples [here](https://github.com/temporalio/samples-java/tree/main/src/main/java/io/temporal/samples/polling) if it helps).
