# Can a Workflow call a Workflow if the Target Table is the same?

**URL:** <https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355>\
**Category:** Ask for Help\
**Created:** [December 4, 2024, 3:22pm UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355 "2024-12-04T15:22:05Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattLB](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mattlb/32/41284_2.png) [@MattLB](https://community.glideapps.com/u/MattLB)\
**Post date:** [December 4, 2024, 3:22pm UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/1 "2024-12-04T15:22:05Z")

</div>

99.99% you can not…but who knows what is in the Enterprise plan 🙂

But…is this on the Roadmap anywhere?

Doesn’t this make sense and is reasonable/doable?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 5, 2024, 12:14am UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/2 "2024-12-05T00:14:03Z")

</div>

Not sure what your use case is, but if it is triggering another workflow using a workflow itself, then the “webhook trigger” workflow is what you need.

It’s in beta for Business and Teams starting today.

---

<div class="post-metadata">

**Author:** ![worldclasstax](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/worldclasstax/32/83040_2.png) [@worldclasstax](https://community.glideapps.com/u/worldclasstax)\
**Post date:** [December 18, 2024, 10:19pm UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/3 "2024-12-18T22:19:31Z")

</div>

It’s not clear what to do once the Glide webhook is triggered. How do I parse the incoming request body so that I can look up a record and then update a field? Or is this not yet possible and I should just use Make?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 18, 2024, 11:20pm UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/4 "2024-12-18T23:20:39Z")

</div>

Can you describe more about your use case? What data flows in, and what are you trying to do with it?

Can it just be done with a relation and a set column action instead?

---

<div class="post-metadata">

**Author:** ![worldclasstax](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/worldclasstax/32/83040_2.png) [@worldclasstax](https://community.glideapps.com/u/worldclasstax)\
**Post date:** [December 19, 2024, 12:03am UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/5 "2024-12-19T00:03:22Z")

</div>

It’s triggered at the end of a custom form. All of the data collected is to be used to create and populate other records and I can’t think of another way to currently do that within Glide.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 19, 2024, 1:01am UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/6 "2024-12-19T01:01:31Z")

</div>

Can you describe your data structure?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 19, 2024, 3:16am UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/7 "2024-12-19T03:16:48Z")

</div>

- Build a JSON payload of add/update mutations
- Use a Call API or Trigger Webhook action to pass the JSON payload to a webhook triggered workflow
- In that workflow, you need 2 steps:  
– the first step should use Query JSON to parse the incoming data payload  
– the second step should use Call API to pass the payload to the Glide API

I’ve used this method and it works perfectly fine. Here is what it looks like:

- Workflow 1 (User Triggered)  

- Workflow 2 (Webhook Triggered)  

The question could be asked why not just call the Glide API directly from the user triggered workflow. That can be done, and will work, but can result in a less than optimal user experience as the Call API action will block and wait for a response from the API. By offloading this to the second workflow, this processing happens in the background without affecting the end user.

---

<div class="post-metadata">

**Author:** ![worldclasstax](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/worldclasstax/32/83040_2.png) [@worldclasstax](https://community.glideapps.com/u/worldclasstax)\
**Post date:** [December 19, 2024, 4:33pm UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/8 "2024-12-19T16:33:27Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/f/3f90aaa1344d67006b3dc27b2915484aa4e9033d.png)

In the Query JSON step, are you just supposed to query one value at a time?

Also, is it possible to find a record in a specific table (via a row ID provided in the webhook request), and then update that record using the values in the request body? I’ve run into this in other workflows, where I want to look up a record and then update it, but it doesn’t seem to be possible if the record isn’t in the workflow’s source table.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 20, 2024, 12:29am UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/9 "2024-12-20T00:29:16Z")

</div>

> [@worldclasstax](#):
>
> In the Query JSON step, are you just supposed to query one value at a time?

It depends on what you need there. It uses JSONata, so you can be flexible.

> [@worldclasstax](#):
>
> Also, is it possible to find a record in a specific table (via a row ID provided in the webhook request), and then update that record using the values in the request body?

I imagine that should be possible, as long as you can parse the ID you need.

 ![CleanShot 2024-12-20 at 07.24.45](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/7/d7184e16aaa0643895c8c6e1ef38699255979867.png)

Maybe something like this?

But if you have mutliple columns that needs to be updated, I imagine that means one more Query JSON module to get the data out in the format you need, then use a Call API step.

---

<div class="post-metadata">

**Author:** ![worldclasstax](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/worldclasstax/32/83040_2.png) [@worldclasstax](https://community.glideapps.com/u/worldclasstax)\
**Post date:** [December 20, 2024, 2:45am UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/10 "2024-12-20T02:45:40Z")

</div>

Ah, ok so I just need to learn JSONata. This is so helpful, thank you!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 20, 2024, 2:50am UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/11 "2024-12-20T02:50:52Z")

</div>

Let us know if you need any further help with that. ChatGPT/Claude can write decent JSONata queries as well if you don’t need something too complicated.

---

<div class="post-metadata">

**Author:** ![worldclasstax](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/worldclasstax/32/83040_2.png) [@worldclasstax](https://community.glideapps.com/u/worldclasstax)\
**Post date:** [December 20, 2024, 3:40am UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/12 "2024-12-20T03:40:12Z")

</div>

Ok, so I just learned that I can’t use JSONata in the fields for setting the new values, but surely I don’t need a query step for each of these values right? Am I missing something?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/7/07d8fb0fb9d775c7604ab9ef8cadfabd8419cd09.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 20, 2024, 3:54am UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/13 "2024-12-20T03:54:23Z")

</div>

You should only need a single JSON Query step. Just ensure that your JSON is correctly constructed in the first place so that it can be passed straight through to the Glide API. This is what mine looks like:

 ![CleanShot 2024-12-20 at 11.52.29@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/d/bd6e01ccaa2feea69fabce760ec3a11f3b5219ee.jpeg)

I Query the above and extract `data`, then that is posted in the body of the subsequent Call API step.

---

<div class="post-metadata">

**Author:** ![worldclasstax](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/worldclasstax/32/83040_2.png) [@worldclasstax](https://community.glideapps.com/u/worldclasstax)\
**Post date:** [December 20, 2024, 4:05am UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/14 "2024-12-20T04:05:37Z")

</div>

I don’t have a problem sending the data between workflows; I’ve already got that working. The issue is mapping the data to the record found in the second workflow. I want to map the business fields to the single record that I pulled from the Accounts table. From what @ThinhDinh shared, it seems like I would have to have a Query JSON step for business.name, business.ein, etc. which I would then use to populate the fields in the found record, but that doesn’t seem right, so I’m wondering if there’s a better approach.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/a/0af7b82db7e585009f73f5ddb40733503f17d133.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 20, 2024, 4:11am UTC](https://community.glideapps.com/t/can-a-workflow-call-a-workflow-if-the-target-table-is-the-same/78355/15 "2024-12-20T04:11:52Z")

</div>

> [@worldclasstax](#):
>
> The issue is mapping the data to the record found in the second workflow. I want to map the business fields to the single record that I pulled from the Accounts table. From what @ThinhDinh shared, it seems like I would have to have a Query JSON step for business.name, business.ein, etc

ah, apologies - I misunderstood.

Yeah, unfortunately that is the only way for now. It is extremely cumbersome, and that point has been made to Glide, and been acknowledged. So I would expect that some time in the future there might be a better way to manage this.
