# Problem on running cross language workflow

**URL:** <https://community.temporal.io/t/problem-on-running-cross-language-workflow/4782>\
**Category:** Community Support\
**Tags:** typescript-sdk\
**Created:** [May 24, 2022, 3:33pm UTC](https://community.temporal.io/t/problem-on-running-cross-language-workflow/4782 "2022-05-24T15:33:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rezaxd](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/rezaxd/32/2105_2.png) [@rezaxd](https://community.temporal.io/u/rezaxd)\
**Post date:** [May 24, 2022, 3:33pm UTC](https://community.temporal.io/t/problem-on-running-cross-language-workflow/4782/1 "2022-05-24T15:33:27Z")

</div>

Hi!  
Just wrote a workflow using python SDK and wanted to use it in ts sdk. So I used protobuffs and followed this document:

> **[Data Converters | Temporal Documentation](https://docs.temporal.io/typescript/data-converters/)**
>
> Learn and customize how data is serialized in the TypeScript SDK

But after I created `json-module.js` by this command:

`pbjs -t json-module -w commonjs -o protos/json-module.js protos/*.proto`

The problem is here when I create a this file I get following error and don’t know what to do. Everything seems to be okay.

**Error Message** :

`TypeError: ($protobuf.roots.default || (intermediate value)(intermediate value)).addJSON is not a function`

**`json-module.js`** :

```javascript
const $protobuf = require("protobufjs/light");

const $root =
  ($protobuf.roots["default"] ||
  ($protobuf.roots["default"] = new $protobuf.Root())).addJSON({
   ....
});

module.exports = $root;

```

Thanks for any help.

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [May 24, 2022, 3:48pm UTC](https://community.temporal.io/t/problem-on-running-cross-language-workflow/4782/2 "2022-05-24T15:48:01Z")

</div>

> So I used protobuffs

Are you using the protobuffs for workflow data inputs?  
I think you can use just default JSON data converters for this.

---

<div class="post-metadata">

**Author:** ![rezaxd](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/rezaxd/32/2105_2.png) [@rezaxd](https://community.temporal.io/u/rezaxd)\
**Post date:** [May 24, 2022, 3:54pm UTC](https://community.temporal.io/t/problem-on-running-cross-language-workflow/4782/3 "2022-05-24T15:54:40Z")

</div>

Hi dear @tihomir !

Yea, the workflow in python sdk, uses protobuffs as data inputs!

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [May 24, 2022, 4:04pm UTC](https://community.temporal.io/t/problem-on-running-cross-language-workflow/4782/4 "2022-05-24T16:04:10Z")

</div>

Tagging @bergundy 🙂

---

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/loren/32/5099_2.png) [@loren](https://community.temporal.io/u/loren)\
**Post date:** [May 24, 2022, 4:16pm UTC](https://community.temporal.io/t/problem-on-running-cross-language-workflow/4782/5 "2022-05-24T16:16:02Z")

</div>

Do you have any other generated protobufs in this TS repo? If so, the “default” root namespace might be clashing. In which case the fix would be adding `--root rezaxd`

If that doesn’t help, does the protobuf sample work for you? If yes, can you tell what the differences are between it and your project? [samples-typescript/protobufs at main · temporalio/samples-typescript · GitHub](https://github.com/temporalio/samples-typescript/tree/main/protobufs)

---

<div class="post-metadata">

**Author:** ![rezaxd](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/rezaxd/32/2105_2.png) [@rezaxd](https://community.temporal.io/u/rezaxd)\
**Post date:** [May 24, 2022, 6:26pm UTC](https://community.temporal.io/t/problem-on-running-cross-language-workflow/4782/6 "2022-05-24T18:26:02Z")

</div>

> [@loren](#):
>
> Do you have any other generated protobufs in this TS repo?

No I don’t have any other PBs.

As I said I followed that document and the repo that related to this document (= the repo that u send me the link of it).

Everything is same, except .proto file and I just declared 2 messages. And weird thing for me is that I can do everything `json-module.js` in node repl without any errors (I don’t know said that maybe it helps).

Thanks so much.

---

<div class="post-metadata">

**Author:** ![lorensr](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/lorensr/32/1709_2.png) [@lorensr](https://community.temporal.io/u/lorensr)\
**Post date:** [May 24, 2022, 6:42pm UTC](https://community.temporal.io/t/problem-on-running-cross-language-workflow/4782/7 "2022-05-24T18:42:36Z")

</div>

I would try adding root to pbjs anyway, just to check. Not sure what the issue is, but I’d be happy to take a look at your repo, if you can share it. I’m @lorensr on GH.

---

<div class="post-metadata">

**Author:** ![rezaxd](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/rezaxd/32/2105_2.png) [@rezaxd](https://community.temporal.io/u/rezaxd)\
**Post date:** [May 25, 2022, 9:03am UTC](https://community.temporal.io/t/problem-on-running-cross-language-workflow/4782/8 "2022-05-25T09:03:12Z")

</div>

Currently I can’t publish the repo.  
But as I said everything is same to this repo/doc.  
The difference is my .proto file:

```auto
syntax = "proto3";

package pkgName;

message InnerMessage {
  string context = 1;
  string name = 3;
}

message OutterMeesage {
  InnerMessage msg_f = 1;
  InnerMessage msg_l = 2;
}

```

---

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/loren/32/5099_2.png) [@loren](https://community.temporal.io/u/loren)\
**Post date:** [May 26, 2022, 9:29pm UTC](https://community.temporal.io/t/problem-on-running-cross-language-workflow/4782/9 "2022-05-26T21:29:57Z")

</div>

That `.proto` should be fine. If you can reproduce, I can look into it more—either taking out all the proprietary stuff from your repo, or modifying the sample to be more like your repo until you get the error.

---

<div class="post-metadata">

**Author:** ![rezaxd](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/rezaxd/32/2105_2.png) [@rezaxd](https://community.temporal.io/u/rezaxd)\
**Post date:** [May 28, 2022, 8:42am UTC](https://community.temporal.io/t/problem-on-running-cross-language-workflow/4782/10 "2022-05-28T08:42:07Z")

</div>

Deleted node\_modules folder and run `npm i` again, seems there is no problem and works properly.

I kinda feel sorry for opening this topic.

Thank u for helping me! \<3
