Create workflow actions for app

I want to create a custom action for my application on hubspot marketplace.
So that whenever a user installs my application, that action should be shown in their panel.

Example : If you install todoist application in your hubspot account you get an option to `Create a task in todoist` based on the trigger set.

How can I do this for my application?

Hi, @neer :waving_hand: Welcome to our community! Here’s a link to the documentation — Custom Workflow Actions.

Have fun building! — Jaycee

I went through this document and made a POST request to the URL mentioned below. It returned a `201 created` response but I can’t find this newly created action while creating workflow in hubspot.

URL : https://api.hubspot.com/automation/v4/actions/{appId}?hapikey={developer_API_key}

{
 "actionUrl": "https://example.com/hubspot",
 "inputFields": [
 {
 "typeDefinition": {
 "name": "widgetName",
 "type": "string",
 "fieldType": "text"
 },
 "supportedValueTypes": ["STATIC_VALUE"],
 "isRequired": true
 },
 {
 "typeDefinition": {
 "name": "widgetColor",
 "type": "enumeration",
 "fieldType": "select",
 "options": [
 { "value": "red", "label": "Red" },
 { "value": "blue", "label": "Blue" },
 { "value": "green", "label": "Green" }
 ]
 },
 "supportedValueTypes": ["STATIC_VALUE"]
 },
 {
 "typeDefinition": {
 "name": "widgetOwner",
 "type": "enumeration",
 "referencedObjectType": "OWNER"
 },
 "supportedValueTypes": ["STATIC_VALUE"]
 },
 {
 "typeDefinition": {
 "name": "widgetQuantity",
 "type": "number"
 },
 "supportedValueTypes": ["OBJECT_PROPERTY"]
 }
 ],
 "labels": {
 "en": {
 "actionName": "Create Widget - Example 1",
 "actionDescription": "This action will create a new widget in our system. So cool!",
 "actionCardContent": "Create widget {{widgetName}}",
 "inputFieldLabels": {
 "widgetName": "Widget Name",
 "widgetColor": "Widget Color",
 "widgetOwner": "Widget Owner",
 "widgetQuantity": "Widget Quantity"
 },
 "inputFieldDescriptions": {
 "widgetName": "Enter the full widget name. I support <a href=\"https://hubspot.com\">links</a> too.",
 "widgetColor": "This is the color that will be used to paint the widget."
 }
 }
 },
 "objectTypes": ["CONTACT", "DEAL"]
}

Hi @neer :waving_hand:

In my experience working with these custom workflow action endpoints, it can take some time (often 5+ minutes) to see the updates you’re making via API be reflected in HubSpot’s UI. Unfortunately, patience is key with these endpoints -- I recommend making a cup of tea in between calls :laughing:

I hope this proves helpful. Please let me know if you have any follow-up questions.

@zach_threadint
Thanks for the reply. Its been 2 days since I created my custom workflow action but its not yet visible in my workflow creation panel.
My app is not published. I am trying this out with a test account and developer account app.

Hi @neer :waving_hand:

I recommend updating your workflow action as “published”. For example:

PATCH /automation/v4/actions/:APP_ID/:WORKFLOW_ACTION_ID?hapikey={{DEVELOPER_API_KEY}}

Request body

{ "actionUrl": "https://my.service/abc", "published": true, "objectTypes": [ "CONTACT", "TICKET" ], "objectRequestOptions": { ... }, "inputFields": [ ... ], "outputFields": [ ... ], "labels": { ... } }

Despite HubSpot documentation suggesting that “unpublished custom actions are only visible in the developer portal associated with the corresponding HubSpot application”, I’ve had no luck in the past testing with “unpublished” workflow actions either in my Developer Portal or its associated Test Accounts. As far as I’m aware, there’s no “workflows” feature available in HubSpot Developer portals, so the documentation is a little misleading. I’ve been meaning to reach out to someone at HubSpot about this for a while, so it’d be great to get some feedback from @Jaycee_Lewis

Thanks Zach, You save my day. It worked.