{"id":2039,"date":"2024-08-08T12:37:07","date_gmt":"2024-08-08T16:37:07","guid":{"rendered":"https:\/\/docs.gravityflow.io\/?p=2039"},"modified":"2025-05-16T10:58:22","modified_gmt":"2025-05-16T14:58:22","slug":"gravityflow_step_status_webhook","status":"publish","type":"post","link":"https:\/\/docs.gravityflow.io\/gravityflow_step_status_webhook\/","title":{"rendered":"gravityflow_step_status_webhook"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-description\">Description<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The gravityflow_step_status_webhook filter allow the step status for the outgoing webhook step to be modified before the step is complete. The initial value of the status for the filter is set based on the HTTP response code received from the webhook:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>complete = Response Code 200 &#8211; 299<\/li>\n\n\n\n<li>error_client = Response Code 400 &#8211; 499<\/li>\n\n\n\n<li>error_server = Response Code 500 &#8211; 599<\/li>\n\n\n\n<li>error = Any other response code<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-parameters\">Parameters<\/h2>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>Parameter<\/th><th>Type<\/th><th>Details<\/th><\/tr><\/thead><tbody><tr><td>$step_status<\/td><td><a href=\"https:\/\/docs.gravityforms.com\/string\">String<\/a><\/td><td>The step status derived from webhook response.<\/td><\/tr><tr><td>$response<\/td><td><a href=\"https:\/\/docs.gravityforms.com\/array\">Array<\/a><\/td><td>The response returned from webhook.<\/td><\/tr><tr><td>$args<\/td><td><a href=\"https:\/\/docs.gravityforms.com\/array\">Array<\/a><\/td><td>The arguments used for executing the webhook request.<\/td><\/tr><tr><td>$current_entry<\/td><td><a href=\"https:\/\/docs.gravityforms.com\/entry-object\/\">Entry<\/a><\/td><td>The current entry.<\/td><\/tr><tr><td>$current_step<\/td><td><a href=\"https:\/\/docs.gravityflow.io\/step-class\/\">Step<\/a><\/td><td>\u00a0The current step.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-examples\">Examples<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-treat-301-as-a-server-error\">Treat 301 as a server error<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( &#039;gravityflow_step_status_webhook&#039;, &#039;sh_filter_gravityflow_step_status_webhook&#039;, 10, 5 );\nfunction sh_filter_gravityflow_step_status_webhook( $step_status, $response, $args, $current_entry, $current_step ) {\n\tif ( isset( $response&#x5B;&#039;response&#039;]&#x5B;&#039;code&#039;] ) ) {\n                $http_response_code = intval( $response&#x5B;&#039;response&#039;]&#x5B;&#039;code&#039;] );\n\t\t\/\/Treat a 301 (Moved Permanently) as a Server Error that you might notify admin for workflow step settings update.\n\t\tif( $http_response_code == 301 ) {\n\t\t\t$step_status = &#039;error_server&#039;;\n\t\t}\n\t}\n\treturn $step_status;\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">You may want to add a filter to <a href=\"https:\/\/docs.gravityflow.io\/gravityflow_response_message_webhook\/\">gravityflow_response_message_webhook<\/a> in combination with this filter.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-placement\">Placement<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This code can be used in the <a href=\"https:\/\/developer.wordpress.org\/themes\/basics\/theme-functions\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">functions.php<\/a> file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">See also the PHP section in this article: <a href=\"https:\/\/docs.gravityflow.io\/where-do-i-put-this-code\/\" target=\"_blank\" rel=\"noreferrer noopener\">Where Do I Put This Code?<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The gravityflow_step_status_webhook filter allow the step status for the outgoing webhook step to be modified before the step is complete.<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_autodraft_ids":[],"_sb_is_suggestion_mode":false,"_sb_show_suggestion_boards":false,"_sb_show_comment_boards":false,"_sb_suggestion_history":"","_sb_update_block_changes":"","_is_real_time_mode":false,"_realtime_collaborators":"","footnotes":"","cf_checklist_status":[]},"categories":[17],"tags":[78],"class_list":["post-2039","post","type-post","status-publish","format-standard","hentry","category-gravityflow_actions_filters","tag-developer-docs","wpautop"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.7) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>gravityflow_step_status_webhook - Gravity Flow Documentation<\/title>\n<meta name=\"description\" content=\"The gravityflow_step_status_webhook filter allow the step status for the outgoing webhook step to be modified before the step is complete.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/docs.gravityflow.io\/gravityflow_step_status_webhook\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"gravityflow_step_status_webhook\" \/>\n<meta property=\"og:description\" content=\"The gravityflow_step_status_webhook filter allow the step status for the outgoing webhook step to be modified before the step is complete.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/docs.gravityflow.io\/gravityflow_step_status_webhook\/\" \/>\n<meta property=\"og:site_name\" content=\"Gravity Flow Documentation\" \/>\n<meta property=\"article:published_time\" content=\"2024-08-08T16:37:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-16T14:58:22+00:00\" \/>\n<meta name=\"author\" content=\"Dario N\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dario N\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/docs.gravityflow.io\\\/gravityflow_step_status_webhook\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/docs.gravityflow.io\\\/gravityflow_step_status_webhook\\\/\"},\"author\":{\"name\":\"Dario N\",\"@id\":\"https:\\\/\\\/docs.gravityflow.io\\\/#\\\/schema\\\/person\\\/b5ba366456b95793521156719fcc3840\"},\"headline\":\"gravityflow_step_status_webhook\",\"datePublished\":\"2024-08-08T16:37:07+00:00\",\"dateModified\":\"2025-05-16T14:58:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/docs.gravityflow.io\\\/gravityflow_step_status_webhook\\\/\"},\"wordCount\":134,\"commentCount\":0,\"keywords\":[\"developer docs\"],\"articleSection\":[\"Gravity Flow Actions and Filters\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/docs.gravityflow.io\\\/gravityflow_step_status_webhook\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/docs.gravityflow.io\\\/gravityflow_step_status_webhook\\\/\",\"url\":\"https:\\\/\\\/docs.gravityflow.io\\\/gravityflow_step_status_webhook\\\/\",\"name\":\"gravityflow_step_status_webhook - Gravity Flow Documentation\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/docs.gravityflow.io\\\/#website\"},\"datePublished\":\"2024-08-08T16:37:07+00:00\",\"dateModified\":\"2025-05-16T14:58:22+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/docs.gravityflow.io\\\/#\\\/schema\\\/person\\\/b5ba366456b95793521156719fcc3840\"},\"description\":\"The gravityflow_step_status_webhook filter allow the step status for the outgoing webhook step to be modified before the step is complete.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/docs.gravityflow.io\\\/gravityflow_step_status_webhook\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/docs.gravityflow.io\\\/gravityflow_step_status_webhook\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/docs.gravityflow.io\\\/gravityflow_step_status_webhook\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/docs.gravityflow.io\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"gravityflow_step_status_webhook\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/docs.gravityflow.io\\\/#website\",\"url\":\"https:\\\/\\\/docs.gravityflow.io\\\/\",\"name\":\"Gravity Flow Documentation\",\"description\":\"Gravity Flow Documentation\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/docs.gravityflow.io\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/docs.gravityflow.io\\\/#\\\/schema\\\/person\\\/b5ba366456b95793521156719fcc3840\",\"name\":\"Dario N\",\"url\":\"https:\\\/\\\/docs.gravityflow.io\\\/author\\\/darion\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"gravityflow_step_status_webhook - Gravity Flow Documentation","description":"The gravityflow_step_status_webhook filter allow the step status for the outgoing webhook step to be modified before the step is complete.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/docs.gravityflow.io\/gravityflow_step_status_webhook\/","og_locale":"en_US","og_type":"article","og_title":"gravityflow_step_status_webhook","og_description":"The gravityflow_step_status_webhook filter allow the step status for the outgoing webhook step to be modified before the step is complete.","og_url":"https:\/\/docs.gravityflow.io\/gravityflow_step_status_webhook\/","og_site_name":"Gravity Flow Documentation","article_published_time":"2024-08-08T16:37:07+00:00","article_modified_time":"2025-05-16T14:58:22+00:00","author":"Dario N","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Dario N","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/docs.gravityflow.io\/gravityflow_step_status_webhook\/#article","isPartOf":{"@id":"https:\/\/docs.gravityflow.io\/gravityflow_step_status_webhook\/"},"author":{"name":"Dario N","@id":"https:\/\/docs.gravityflow.io\/#\/schema\/person\/b5ba366456b95793521156719fcc3840"},"headline":"gravityflow_step_status_webhook","datePublished":"2024-08-08T16:37:07+00:00","dateModified":"2025-05-16T14:58:22+00:00","mainEntityOfPage":{"@id":"https:\/\/docs.gravityflow.io\/gravityflow_step_status_webhook\/"},"wordCount":134,"commentCount":0,"keywords":["developer docs"],"articleSection":["Gravity Flow Actions and Filters"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/docs.gravityflow.io\/gravityflow_step_status_webhook\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/docs.gravityflow.io\/gravityflow_step_status_webhook\/","url":"https:\/\/docs.gravityflow.io\/gravityflow_step_status_webhook\/","name":"gravityflow_step_status_webhook - Gravity Flow Documentation","isPartOf":{"@id":"https:\/\/docs.gravityflow.io\/#website"},"datePublished":"2024-08-08T16:37:07+00:00","dateModified":"2025-05-16T14:58:22+00:00","author":{"@id":"https:\/\/docs.gravityflow.io\/#\/schema\/person\/b5ba366456b95793521156719fcc3840"},"description":"The gravityflow_step_status_webhook filter allow the step status for the outgoing webhook step to be modified before the step is complete.","breadcrumb":{"@id":"https:\/\/docs.gravityflow.io\/gravityflow_step_status_webhook\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/docs.gravityflow.io\/gravityflow_step_status_webhook\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/docs.gravityflow.io\/gravityflow_step_status_webhook\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/docs.gravityflow.io\/"},{"@type":"ListItem","position":2,"name":"gravityflow_step_status_webhook"}]},{"@type":"WebSite","@id":"https:\/\/docs.gravityflow.io\/#website","url":"https:\/\/docs.gravityflow.io\/","name":"Gravity Flow Documentation","description":"Gravity Flow Documentation","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/docs.gravityflow.io\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/docs.gravityflow.io\/#\/schema\/person\/b5ba366456b95793521156719fcc3840","name":"Dario N","url":"https:\/\/docs.gravityflow.io\/author\/darion\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/docs.gravityflow.io\/wp-json\/wp\/v2\/posts\/2039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.gravityflow.io\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.gravityflow.io\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.gravityflow.io\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.gravityflow.io\/wp-json\/wp\/v2\/comments?post=2039"}],"version-history":[{"count":3,"href":"https:\/\/docs.gravityflow.io\/wp-json\/wp\/v2\/posts\/2039\/revisions"}],"predecessor-version":[{"id":4151,"href":"https:\/\/docs.gravityflow.io\/wp-json\/wp\/v2\/posts\/2039\/revisions\/4151"}],"wp:attachment":[{"href":"https:\/\/docs.gravityflow.io\/wp-json\/wp\/v2\/media?parent=2039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.gravityflow.io\/wp-json\/wp\/v2\/categories?post=2039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.gravityflow.io\/wp-json\/wp\/v2\/tags?post=2039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}