# HTTP Workflow Error

**URL:** <https://developer.sailpoint.com/discuss/t/http-workflow-error/5334>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows, sailpoint-identity-security\
**Created:** [August 10, 2022, 10:47am UTC](https://developer.sailpoint.com/discuss/t/http-workflow-error/5334 "2022-08-10T10:47:45Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manju22](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Manju22](https://developer.sailpoint.com/discuss/u/Manju22)\
**Post date:** [August 10, 2022, 10:47am UTC](https://developer.sailpoint.com/discuss/t/http-workflow-error/5334/1 "2022-08-10T10:47:45Z")

</div>

Hi ,

I have built the workflow using “HTTP Request” as action.  
In the Request body, Am trying to pass the attribute which holds the JSON Body (created it using Webservice after rule).  
Attribute Name : ppdSnowflakeStudyRoleBodyUpdate  
Value : {“employeeDetails”:{“employeeName”:{“id”:“name”,“legacyId”:“value”,“firstName”:“value”,“middleName”:“L”,“lastName”:“value”},“employeeLogin”:“value”,“employeeEmail”:“value”,“employeeStatus”:“active”},“access”:[{“studyId”:“value”,“studyName”:“value”,“roleId”:“value”,“role”:“value”,“status”:“active”,“obsolete”:false,“personType”:“Internal”,“grantRelatedRecord”:false,“startDate”:“2015-04-01T18:22:13”,“endDate”:“2015-04-01T18:22:13”,“creationTimestamp”:“2015-04-01T18:22:13”,“lastUpdatedTimestamp”:“2015-04-01T18:23:30”}]}

WorkflowExecutionFailed with error : {“error”:“actionStep(HTTP Request) Error: task failed: activity error (type: sp:external:http:v2, scheduledEventID: 5, startedEventID: 6, identity: 1@10d7d21e961b@): json: cannot unmarshal string into Go struct field externalHTTPInputV2.jsonRequestBody of type map[string]interface {} (type: Error Parsing Input, retryable: false): json: cannot unmarshal string into Go struct field externalHTTPInputV2.jsonRequestBody of type map[string]interface {} (type: UnmarshalTypeError, retryable: true)”}

Can you guide us?

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [August 10, 2022, 3:40pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-error/5334/2 "2022-08-10T15:40:17Z")

</div>

Can you please download your workflow script and send it?

---

<div class="post-metadata">

**Author:** ![Manju22](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Manju22](https://developer.sailpoint.com/discuss/u/Manju22)\
**Post date:** [August 10, 2022, 3:46pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-error/5334/3 "2022-08-10T15:46:30Z")

</div>

![image](https://global.discourse-cdn.com/sailpoint/original/2X/7/7d527b5c57d4a6478581c1dcbf1a3e590b66dc07.png)  
 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/b/ba652a7bc32798314f7d7bdb8997ff0ab89f6313.png)

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [August 10, 2022, 6:04pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-error/5334/4 "2022-08-10T18:04:06Z")

</div>

I wonder if the `attributes.ppdSnowflakeStudyRoleBody` is encoded as a string instead of an object. The workflow execution should log the contents of the attribute. What does it look like?

---

<div class="post-metadata">

**Author:** ![Manju22](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Manju22](https://developer.sailpoint.com/discuss/u/Manju22)\
**Post date:** [August 11, 2022, 5:14am UTC](https://developer.sailpoint.com/discuss/t/http-workflow-error/5334/5 "2022-08-11T05:14:46Z")

</div>

Do you think this issue exist in our tenant?

> [@Saas Workflows Error - json: cannot unmarshal string into Go struct field ManageAccessInput.addIdentities of type \[\]string](https://developer.sailpoint.com/discuss/t/saas-workflows-error-json-cannot-unmarshal-string-into-go-struct-field-manageaccessinput-addidentities-of-type-string/5034/8):
>
> I am facing the same issue too. json: cannot unmarshal object into Go struct field externalHTTPInputV2.jsonRequestBody of type string

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [August 11, 2022, 1:10pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-error/5334/6 "2022-08-11T13:10:09Z")

</div>

This is a different issue. Here’s what’s happening:

When you select a **Request Content Type** of `JSON`, the workflow expects a JSON object in the **Request Body** field. A valid JSON request body would look like this:

```json
{
  "key": "value"
}

```

In your case, you are populating the **Request Body** with a variable from your data stream, `ppdSnowflakeStudyRoleBodyUpdate`. You may have thought that this variable is a JSON object, but when this variable was created in your webservice after rule, it was encoded as a string, not an object. A JSON object encoded as a string will appear like this in the workflow input:

```nohighlight
"{\"key\":\"value\"}"

```

If you look closely at your workflow log, you can see that the value being passed into the body of your HTTP request is encoded as a string, hence the error that it can’t be unmarshalled.

Source accounts can’t store objects, they can only store booleans, integers, and strings. Source accounts aren’t meant to handle complicated objects like this. Workflows doesn’t have the ability to unmarshal a string into an object, so there’s only two solutions to this:

1. If you control the service that you are sending this HTTP request to, then maybe you can update the service to accept `text` in addition to `json`. Then you can add some logic to your service to convert a string into an object. All you would need to do in your **HTTP Request** action is change the **Request Content Type** to `text`.
2. Research a better way to accomplish what you are trying to do with `ppdSnowflakeStudyRoleBodyUpdate`. Storing it in a source account as an object is not a recommended approach. There might be other ways to accomplish what you are trying to do.

---

<div class="post-metadata">

**Author:** ![Manju22](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Manju22](https://developer.sailpoint.com/discuss/u/Manju22)\
**Post date:** [August 11, 2022, 1:49pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-error/5334/7 "2022-08-11T13:49:22Z")

</div>

Thanks Colin for your immediate assistance.

Even If I try to pass the JSON body value directly without using attribute ppdSnowflakeStudyRoleBodyUpdate, I got the same error.

Attached screenshot

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/6/6ae86b39ac0b5a75ff7c8bbcae5fd84bb8fd10f0.png)

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [August 11, 2022, 2:46pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-error/5334/8 "2022-08-11T14:46:26Z")

</div>

Can you send me the script?

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [August 11, 2022, 3:51pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-error/5334/9 "2022-08-11T15:51:56Z")

</div>

Split this topic on August 11, 2022, 3:51pm UTC

A post was split to a new topic: [Workflows: How to dynamically create request body in HTTP action](https://developer.sailpoint.com/discuss/t/workflows-how-to-dynamically-create-request-body-in-http-action/5363)

---

<div class="post-metadata">

**Author:** ![Manju22](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Manju22](https://developer.sailpoint.com/discuss/u/Manju22)\
**Post date:** [August 11, 2022, 3:28pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-error/5334/10 "2022-08-11T15:28:53Z")

</div>

![image](https://global.discourse-cdn.com/sailpoint/original/2X/1/169e837ae188ac6e2a07856033824fbe18dd3b26.png)  
 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/9/9c03d3adc828e1fccbbbbce57c94b5fa38cd8520.png)

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [August 11, 2022, 3:51pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-error/5334/11 "2022-08-11T15:51:03Z")

</div>

That looks like a bug. Your request body is a list of objects. Technically, a JSON schema that begins as an array is not valid according to the JSON RFC. In practice, most JSON tooling will accept an array at the top level, so I’m going to log this as a bug so our Workflows team can fix this and allow arrays at the top level.

However, it’s interesting that you made your input an array of objects when the previous input that came from the account attribute was just an object. If you remove the array wrapping your object it should work.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [July 19, 2023, 2:23pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-error/5334/12 "2023-07-19T14:23:25Z")

</div>

Closed on July 19, 2023, 2:23pm UTC


