Workflow custom action data identification

Hi and thanks for any help you could provide.

I am fairly new to HubSpot so I do apologise if my questions are too basic or have been answered before.

I am trying to implement a custom workflow action to be included in regular workflows when a particular field is known.

I have created a test app, done the OAuth handshake and I am able to obtain information about the user and account id from hubspot at that point in time. Meaning I have established a mapping between the app account and hubspot account (app_acc_id and hub_id - from token metadata).

After creating a workflow custom action I am able to use it in a workflow as expected, but the data sent by HubSpot to the app has no information that I can effectively use to identify the account origin.

- What would be the recommended way of achieving this?

- Does the app need to create a record/property of some sort and request it as part of the workflow action data?

- Can an app setting be used instead?

Ideally we would like zero manual processing from the user, ie the user should only need to install the app.

Sample payload received:

{
 "callbackId": "ap-39703706-575141485615-1-0",
 "origin": {
 "portalId": 39703706,
 "actionDefinitionId": 35783959,
 "actionDefinitionVersion": 4,
 "actionExecutionIndexIdentifier": {
 "enrollmentId": 575141485615,
 "actionExecutionIndex": 0
 },
 "extensionDefinitionId": 35783959,
 "extensionDefinitionVersionId": 4
 },
 "context": {
 "source": "WORKFLOWS",
 "workflowId": 377557936
 },
 "object": {
 "objectId": 51,
 "objectType": "CONTACT"
 },
 "fields": {
 "platform": "Sample Platform",
 "cid": "Halligan (Sample Contact)"
 },
 "inputFields": {
 "platform": "Sample Platform",
 "cid": "Halligan (Sample Contact)"
 }
}

Update: It seems as if the “portalId” is what I need as it seems to have the same value as the `hub_id` that I got earlier. Please confirm if that is what I need to use? (if moderators remove the spam mark on my message). Thanks

Hey, @frequeno :waving_hand: Did you get this resolved? To confirm, portalID = HubID.

Best,

Jaycee

Thanks for confirming @Jaycee_Lewis :+1:. We will use that field to do our mapping.

Now I just need to understand how app settings can be used in a workflow action. Is there something you can comment on that? If we need text fields is that only doable through iframes? That’s what it seems by what’s described here Create a settings page for a legacy public app - HubSpot docs