---
title: "Restarting a Gravity Flow workflow after editing a field with GravityEdit"
date: 2026-04-23
author: "GravityKit"
link: "https://www.gravitykit.com/docs/gravityedit/restarting-a-gravity-flow-workflow-after-editing-a-field-with-gravityedit/"
---

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 a field with **GravityEdit** (formerly known as **Inline Edit**).

```
add_filter( 'gravityview-inline-edit/entry-updated', 'gravityedit_trigger_workflow', 10, 5 );

function gravityedit_trigger_workflow( $update_result, $entry = array(), $form_id = 0, $gf_field = null, $original_entry = array() ) { 
	
	$run_on_forms = [10, 20, 30]; //The IDs of the Forms you'd like to affect

	if( ! in_array( $form_id, $run_on_forms ) ){
		return $update_result;
	}
        
        $run_on_fields = [1, 2, 3]; // If the edited field is not one of the specified fields, do not restart the workflow

        if ( ! in_array( $gf_field->id, $run_on_fields ) ) {
                return $update_result;
        }

	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( $entry );
	remove_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );
		
    return $update_result;
}
```

```
add_filter( 'gravityview-inline-edit/entry-updated', 'gravityedit_trigger_workflow', 10, 5 );

function gravityedit_trigger_workflow( $update_result, $entry = array(), $form_id = 0, $gf_field = null, $original_entry = array() ) { 
	
	$run_on_forms = [10, 20, 30]; //The IDs of the Forms you'd like to affect

	if( ! in_array( $form_id, $run_on_forms ) ){
		return $update_result;
	}
        
        $run_on_fields = [1, 2, 3]; // If the edited field is not one of the specified fields, do not restart the workflow

        if ( ! in_array( $gf_field->id, $run_on_fields ) ) {
                return $update_result;
        }

	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( $entry );
	remove_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );
		
    return $update_result;
}
```

This code **doesn't work** when editing entries in [GravityView's Edit Entry](https://www.gravitykit.com/docs/gravityview/edit-entry/user-edit-allow-users-to-edit-their-own-entries/) page. We have [another code snippet](https://www.gravitykit.com/docs/gravityview/advanced/restarting-a-gravity-flow-workflow-after-editing-an-entry/) 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/).