---
title: "Restarting a Gravity Flow workflow after editing an entry in GravityView"
date: 2026-04-23
author: "GravityKit"
link: "https://www.gravitykit.com/docs/gravityview/advanced/restarting-a-gravity-flow-workflow-after-editing-an-entry/"
---

The code sample below targets specific forms by their IDs. Make sure to change those to the specific form ID connected to your View.

The code below restarts a Gravity Flow workflow after editing an entry in [GravityView's Edit Entry](https://www.gravitykit.com/docs/gravityview/edit-entry/user-edit-allow-users-to-edit-their-own-entries/) page.

```
add_action('gravityview/edit_entry/after_update', function ( $form = array(), $entry_id = array(), $object ) {

	//The IDs of the Forms you'd like to affect. To target more forms, use [36,81,12] as an example
	$run_on_forms = [36]; 
	
	if(!in_array($form['id'], $run_on_forms)){
		return;
        }

        if( ! class_exists('Gravity_Flow_API') ) {
		return;
	}

	add_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );

	$api = new Gravity_Flow_API( $form['id'] );
	$api->restart_workflow( $object->entry );
	
	remove_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );

}, 10, 3 );
```

```
add_action('gravityview/edit_entry/after_update', function ( $form = array(), $entry_id = array(), $object ) {

	//The IDs of the Forms you'd like to affect. To target more forms, use [36,81,12] as an example
	$run_on_forms = [36]; 
	
	if(!in_array($form['id'], $run_on_forms)){
		return;
        }

        if( ! class_exists('Gravity_Flow_API') ) {
		return;
	}

	add_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );

	$api = new Gravity_Flow_API( $form['id'] );
	$api->restart_workflow( $object->entry );
	
	remove_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );

}, 10, 3 );
```

This code **doesn't work** when editing entries with **GravityEdit** (formerly known as Inline Edit). We have [another code snippet](https://www.gravitykit.com/docs/gravityedit/restarting-a-gravity-flow-workflow-after-editing-a-field-with-gravityedit/) for that.

If you are not sure how to add custom code to your theme, please [take a look at this article](https://www.gravitykit.com/docs/gravityview/customizing-your-views/where-to-put-code-samples/).