# How to create workflow with Custom workflow action?

**URL:** <https://community.hubspot.com/t/how-to-create-workflow-with-custom-workflow-action/121175>\
**Category:** APIs & Integrations\
**Tags:** workflows\
**Created:** [November 22, 2024, 11:11am UTC](https://community.hubspot.com/t/how-to-create-workflow-with-custom-workflow-action/121175 "2024-11-22T11:11:41Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![KPadhiyar](https://avatars.discourse-cdn.com/v4/letter/k/7993a0/32.png) [@KPadhiyar](https://community.hubspot.com/u/KPadhiyar)\
**Post date:** [April 23, 2025, 11:39am UTC](https://community.hubspot.com/t/how-to-create-workflow-with-custom-workflow-action/121175/5 "2025-04-23T11:39:13Z")

</div>

@SteveHTM @Josh  
Also, I’ve below code and got this error:

```lia-code-sample
$requestBody = [
 'type' => 'CONTACT_FLOW',
 'name' => 'Test WorkFlow',
 'description' => 'Test WorkFlow',
 'canEnrollFromSalesforce' => false,
 'isEnabled' => true,
 'flowType' => 'WORKFLOW',
 'crmObjectCreationStatus' => 'COMPLETE',
 'objectTypeId' => '0-1',
 'startActionId' => 'actionId',
 'enrollmentCriteria' => ['shouldReEnroll' => true, 'type' => 'MANUAL'],
 'objectType' => 'CONTACT',
 'actions' => [
 [
 'type' => 'SINGLE_CONNECTION',
 'actionId' => 'actionId',
 'actionTypeVersion' => 0,
 'actionTypeId' => '0-1',
 'fields' => [
 'fieldName' => 'fieldValue'
 ]
 ]
 ]
];

$response = Http::withToken('access_token')
 ->accept('application/json')
 ->timeout(30)
 ->post('https://api.hubapi.com/automation/v4/flows', $requestBody);

$responseBody = $response->json();

```

```

[

“status” =\> “error”,

“message” =\> “internal error”,

“correlationId” =\> “c3bf5626-0afa-4a22-8d7f-4647d7fa0164”,

]

```

---

_[View the full topic](https://community.hubspot.com/t/how-to-create-workflow-with-custom-workflow-action/121175)._
