Gravity Flow workflow trigger

I’m trying to create a Gravity Flow workflow triggered by the Gravity View approval button.
How do I code a snippet to get a gravity flow workflow created on GV approval(as opposed to approval being a step in the workflow)
Is there a hook I can use to change the trigger?
How would I go about coding this?
Thank you.

Hi Boruch,

The default behaviour is a 1:1 correlation b/t a Gravity Form entry and a Gravity Flow workflow associated to it. When the entry is submitted/created its’ workflow starts. The existing ways that Gravity Flow supports/integrates with GravityView are described here.

A couple further thoughts/links that may help you:

  • If you want the GView approval to create a new entry/workflow in a different form, you would use the GFAPI to create an entry within a hook that GView provides. I don’t know that gravityview/edit_entry/after_update is the right hook for View approval, but their doc for restarting a workflow shows an example of how to use it in relation to an existing entry/workflow.
  • If the workflow “starting” is for the same entry that the GravityView approval is being performed on, you may want to use the Gravity Flow Orchestration API to send the entry to a different step. The workflow would start on initial form submission, but be setup with an initial user input or approval step assigned to someone that would never action it via the UI. Then, via that same TBD hook in Gravity View, you would send the workflow on to its first “real” step for assignees to interact with.

Cheers,
Jamie

Hi, Thank you for taking time to review and answer my question.

I see what you are saying, however I need the Gravity View approval to be the step that triggers the entire workflow?

Is there a way that that could be done? And how?
Thank you again for your patience and time.

View does have a few hooks that could be the trigger source to what I suggested above.
gravityview/approve_entries/disapproved
gravityview/approve_entries/unapproved
gravityview/approve_entries/updated
gravityview/approve_entries/approved

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.