APIs & Integrations

MaximeEsnol
Participant

Unable to update workflow extension definition for seemingly no reason

In one of our apps we are using a workflow extension definition. We are trying to update the name of this workflow extension definition. We are finding there to be a few different issues while trying to update the definition.

 

The main issue is that we seem to be unable to update this workflow definition anymore. If we try to update it with the payload shown below, where we set some fields to be required: 

 

{
        "integrationAppId": ***,
        "extensionName": "Send Contact data to bpost Plug & Send Test",
        "latestVersion": 326,
        "webhookUrl": "***",
        "dataUrl": "***",
        "fieldMetadata": [
            {
                "key": "address1",
                "label": "Address 1",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "city",
                "label": "City",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "country",
                "label": "Country",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "firstname",
                "label": "First Name",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "lastname",
                "label": "Last Name",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "address2",
                "label": "Address 2",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "postcode",
                "label": "Postal Code",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "sku",
                "label": "Mailing Template",
                "values": [
                    {
                        "type": "EXTERNAL_DATA"
                    }
                ],
                "fieldType": "SELECT",
                "required": true
            },
            {
                "key": "qrurl",
                "label": "QR URL",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "customfield1",
                "label": "Custom field 1",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "customfield2",
                "label": "Custom field 2",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "customfield3",
                "label": "Custom field 3",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "customfield4",
                "label": "Custom field 4",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "customfield5",
                "label": "Custom field 5",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "customfield6",
                "label": "Custom field 6",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "customfield7",
                "label": "Custom field 7",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "customfield8",
                "label": "Custom field 8",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "customfield9",
                "label": "Custom field 9",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "customfield10",
                "label": "Custom field 10",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": true
            },
            {
                "key": "disclaimer",
                "label": "By choosing \"Yes\" you are saving your configuration & acknowledging that any active campaign that generates orders, using the plugin, will be billed.",
                "values": [
                    {
                        "type": "EXTERNAL_DATA"
                    }
                ],
                "fieldType": "SELECT",
                "required": true
            }
        ],
        "lambdas": {},
        "id": ****,
        "version": 326
    }

 

then we get the error response shown below:

{
    "status": "error",
    "message": "There was a problem with the request.",
    "correlationId": "e9d63452-3860-46e9-8f7a-85152a6f9e69"
}

 

When we try the same request, but with the field ‘required’ set to ‘false’, then the update comes through, however this is not the behavior we want as some of these fields are mandatory.

 

Another interesting issue with the request above, is that in ‘fieldMetadata’, we have a field named 'disclaimer'. However, we get the same error as above if in our update request we use ‘disclaimer’ as the name. However, when we change the name of that field to ‘disclaimernew’ or anything else AND we set ‘required’: false, then the update comes through.

 

The request below is an example of a a request where the update is done successfully:

 

{
        "integrationAppId": ***,
        "extensionName": "Send Contact data to bpost Plug & Send Test",
        "latestVersion": 326,
        "webhookUrl": "***",
        "dataUrl": "***",
        "fieldMetadata": [
            {
                "key": "address1",
                "label": "Address 1",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "city",
                "label": "City",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "country",
                "label": "Country",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "firstname",
                "label": "First Name",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "lastname",
                "label": "Last Name",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "address2",
                "label": "Address 2",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "postcode",
                "label": "Postal Code",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "sku",
                "label": "Mailing Template",
                "values": [
                    {
                        "type": "EXTERNAL_DATA"
                    }
                ],
                "fieldType": "SELECT",
                "required": false
            },
            {
                "key": "qrurl",
                "label": "QR URL",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "customfield1",
                "label": "Custom field 1",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "customfield2",
                "label": "Custom field 2",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "customfield3",
                "label": "Custom field 3",
                "values": [
                    {
                        "allowsMergeTags": false,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "customfield4",
                "label": "Custom field 4",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "customfield5",
                "label": "Custom field 5",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "customfield6",
                "label": "Custom field 6",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "customfield7",
                "label": "Custom field 7",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "customfield8",
                "label": "Custom field 8",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "customfield9",
                "label": "Custom field 9",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "customfield10",
                "label": "Custom field 10",
                "values": [
                    {
                        "allowsMergeTags": null,
                        "type": "STATIC_VALUE",
                        "options": []
                    }
                ],
                "fieldType": "TEXT",
                "required": false
            },
            {
                "key": "disclaimernew",
                "label": "By choosing \"Yes\" you are saving your configuration & acknowledging that any active campaign that generates orders, using the plugin, will be billed.",
                "values": [
                    {
                        "type": "EXTERNAL_DATA"
                    }
                ],
                "fieldType": "SELECT",
                "required": false
            }
        ],
        "lambdas": {},
        "id": ****,
        "version": 326
    }

 

Otherwise, not. Interestingly, these issues only appear when we try to update this specific workflow definition. For the sake of testing and debuggin, we have created a new definition, there we are able to update the workflow definition successfully. However, when performing the exact same request that works with the 'new' workflow extension on the 'old' one (using a different extensionName to avoid duplicate name error), the request will again fail with status code 409 and the error shown above.

 

Using the new workflow definition would not be easy, as it would mean all workflows already existing that rely on the ‘old’ definition would no longer work. 

0 Upvotes
2 Replies 2
MaximeEsnol
Participant

Unable to update workflow extension definition for seemingly no reason

Hi @Jaycee_Lewis thanks for your reply, however I am not trying to add new fields to the workflow extension. Even when keeping the initial required fields to 'required = true', the error occurs and makes it unable to do any other updates to the workflow extension

 

Kind regards,

Maxime

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Unable to update workflow extension definition for seemingly no reason

Hey, @MaximeEsnol 👋 To confirm, you are not missing anything. When updating, you have to set it to the required field to = false. This post and reply give additional details — Can't add new required fields 

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes