# How to update Workflow State in a Rule via Formula?

**URL:** https://community.fibery.io/t/how-to-update-workflow-state-in-a-rule-via-formula/2970
**Category:** Get Help
**Tags:** automations
**Created:** [June 17, 2022, 9:42pm UTC](https://community.fibery.io/t/how-to-update-workflow-state-in-a-rule-via-formula/2970 "2022-06-17T21:42:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)
#### Post date: [June 17, 2022, 9:42pm UTC](https://community.fibery.io/t/how-to-update-workflow-state-in-a-rule-via-formula/2970/1 "2022-06-17T21:42:19Z")

</div>

I can’t wrap my head around how to do this. I want something like:

```auto
If( MatchRegex([Step 1 Task].State.Name,"Waiting"),
[Step 1 Task].State.Filter(Name="Progress").Sort().First(), // Choose a new State
[Step 1 Task].State) // Keep current State
)

```
