# Invoke workflow arguments error

**URL:** <https://forum.uipath.com/t/invoke-workflow-arguments-error/73344>\
**Category:** Help\
**Tags:** mail, system, activities\
**Created:** [October 30, 2018, 12:02pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344 "2018-10-30T12:02:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Cross](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alex_cross/32/30532_2.png) [@Alex\_Cross](https://forum.uipath.com/u/Alex_Cross)\
**Post date:** [October 30, 2018, 12:02pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/1 "2018-10-30T12:02:39Z")

</div>

Hi guys,

I have built a component to email the reports which are produced through my automation, and I am invoking this within its own “State”. My problem is that when I use the following:

 ![image](https://global.discourse-cdn.com/uipath/original/3X/e/5/e5fd0333f00fec1956d944325421ffba3b79594f.png)  
I get an error, which states that “Send SMTP Mail Message : Object reference not set to an instance of an object.”

So I assume from this something being called in is “incorrect”. To bypass this I can copy/paste the values from the config file and place them between quotes, and the component works as intended. I can’t seem to troubleshoot this myself, and am perhaps overlooking something relatively simple, does anyone have any ideas? The email address are separated by commas, and are not hyperlinks. The subject of the email contains a & sign, however when copied in directly this works fine, and the file location works fine in all other components it is invoked within. My only thought could be the & in the subject, but does anyone have an idea around this, as the email subject has to contain that (not my choice!).

Thanks!

Alex

---

<div class="post-metadata">

**Author:** ![PrankurJoshi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/prankurjoshi/32/37212_2.png) [@PrankurJoshi](https://forum.uipath.com/u/PrankurJoshi)\
**Post date:** [October 30, 2018, 12:09pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/2 "2018-10-30T12:09:46Z")

</div>

Hi @Alex_Cross

Did you try to print all the values in Parent workflow? It clearly seems to be something missing which is required for SMTP activity

Or if you can share a sample

Thanks,  
Prankur

---

<div class="post-metadata">

**Author:** ![KarthikByggari](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/karthikbyggari/32/430060_2.png) [@KarthikByggari](https://forum.uipath.com/u/KarthikByggari)\
**Post date:** [October 30, 2018, 12:11pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/3 "2018-10-30T12:11:53Z")

</div>

Hi @Alex_Cross

I guess you are missing to set some of the Send SMTP mail message activity properties.

Please re-check the properties like server, port, username, password…

Regards,  
Karthik Byggari

---

<div class="post-metadata">

**Author:** ![Alex\_Cross](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alex_cross/32/30532_2.png) [@Alex\_Cross](https://forum.uipath.com/u/Alex_Cross)\
**Post date:** [October 30, 2018, 2:26pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/4 "2018-10-30T14:26:29Z")

</div>

I first thought it would be a missing port/etc, but as I said, when I type the arguments in manually I don’t get an error, it’s only when it calls the arguments in from the config file, which are only Subject, list of email addresses to send to, CC list, and the location of the attachments?

@PrankurJoshi thanks, I will try and print them out now, to see what is pulled and let you know!

---

<div class="post-metadata">

**Author:** ![Alex\_Cross](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alex_cross/32/30532_2.png) [@Alex\_Cross](https://forum.uipath.com/u/Alex_Cross)\
**Post date:** [October 30, 2018, 5:20pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/5 "2018-10-30T17:20:00Z")

</div>

So I have created a sandbox/test environment, and copied in this invoke there, and have changed ONLY the imported arguments, and I have copy and pasted these from the config file - therefore I can only assume that something in these arguments is causing the issue.

I have created log messages and it appears that the values are being pulled in correctly and that the config file is a known argument so it can read from it, so does anyone have any ideas of anything simple I might be missing?

---

<div class="post-metadata">

**Author:** ![Alex\_Cross](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alex_cross/32/30532_2.png) [@Alex\_Cross](https://forum.uipath.com/u/Alex_Cross)\
**Post date:** [October 31, 2018, 4:37pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/6 "2018-10-31T16:37:58Z")

</div>

Hi Prankur,

I am attaching the xml file, and as I said, on its own, this works, and emails me as desired. For whatever reason, when this is included within the main workflow however, it seems to error out as above, even though other than the arguments nothing has been changed. Many thanks for any time you can spend helping me with this!

[UPSMTP\_OpenPopulateNewEmail.xaml](https://global.discourse-cdn.com/uipath/original/3X/6/e/6ebaf931b56bd45027961c968417fc6f53da339f.xaml) (23.6 KB)

---

<div class="post-metadata">

**Author:** ![nadim.warsi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nadim.warsi/32/30741_2.png) [@nadim.warsi](https://forum.uipath.com/u/nadim.warsi)\
**Post date:** [November 1, 2018, 11:53am UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/7 "2018-11-01T11:53:41Z")

</div>

So when you run it individually it works end to end without any error?  
The email comes out well without any error?

---

<div class="post-metadata">

**Author:** ![Rishi1](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@Rishi1](https://forum.uipath.com/u/Rishi1)\
**Post date:** [November 1, 2018, 12:15pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/8 "2018-11-01T12:15:43Z")

</div>

Hi @Alex_Cross  
Can you share the config file ? and I didn’t find any activity in your workflow where you are reading all the details from the config file. I mean you are passing all those arguments from the config file then there should be an activity to read the data from config file.

---

<div class="post-metadata">

**Author:** ![Alex\_Cross](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alex_cross/32/30532_2.png) [@Alex\_Cross](https://forum.uipath.com/u/Alex_Cross)\
**Post date:** [November 1, 2018, 12:25pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/9 "2018-11-01T12:25:08Z")

</div>

Correct yeah, works just fine on its own.

---

<div class="post-metadata">

**Author:** ![Alex\_Cross](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alex_cross/32/30532_2.png) [@Alex\_Cross](https://forum.uipath.com/u/Alex_Cross)\
**Post date:** [November 1, 2018, 12:36pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/10 "2018-11-01T12:36:22Z")

</div>

This is within an “Email State” I created in a ReFramework within the standard UiPath template, so the config is read in “INIT” and passed in here. I did think it was having trouble reading from the config file, but also when I manually type in the values here, it also errors out with the same error.

 ![image](https://global.discourse-cdn.com/uipath/original/3X/c/a/ca6165ca57f25c00c8b36ea3440d3d6b60aab62a.png)

Where the following are the arguments

 ![image](https://global.discourse-cdn.com/uipath/original/3X/0/0/005394d96f4e40471952fcb42e12969b3358150a.png)

Thanks

---

<div class="post-metadata">

**Author:** ![Alex\_Cross](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alex_cross/32/30532_2.png) [@Alex\_Cross](https://forum.uipath.com/u/Alex_Cross)\
**Post date:** [November 1, 2018, 4:03pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/11 "2018-11-01T16:03:27Z")

</div>

I have tried copying the INIT invoke which initialises the config file into this “Email State” and still receiving this error.

When I have tried copying these two invokes into my sandbox (so config is there, ie I’m now changing NOTHING) they work perfectly, has anyone got a clue why this is happening? Thanks!

---

<div class="post-metadata">

**Author:** ![nadim.warsi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nadim.warsi/32/30741_2.png) [@nadim.warsi](https://forum.uipath.com/u/nadim.warsi)\
**Post date:** [November 1, 2018, 5:43pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/12 "2018-11-01T17:43:19Z")

</div>

What about the username and password?

---

<div class="post-metadata">

**Author:** ![Alex\_Cross](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alex_cross/32/30532_2.png) [@Alex\_Cross](https://forum.uipath.com/u/Alex_Cross)\
**Post date:** [November 1, 2018, 5:49pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/13 "2018-11-01T17:49:57Z")

</div>

It’s smtp so does not require them? It works just fine without in the test mode

---

<div class="post-metadata">

**Author:** ![nadim.warsi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nadim.warsi/32/30741_2.png) [@nadim.warsi](https://forum.uipath.com/u/nadim.warsi)\
**Post date:** [November 1, 2018, 5:57pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/14 "2018-11-01T17:57:06Z")

</div>

Actually i tested you xaml individually and via an invoke and its working fine.  
Just that im not using the smtp and the error you are getting is related to that only.

Wondering what you may be doing differently when doing the invoke that your smtp fails

Your arguments are in sync?

---

<div class="post-metadata">

**Author:** ![Alex\_Cross](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alex_cross/32/30532_2.png) [@Alex\_Cross](https://forum.uipath.com/u/Alex_Cross)\
**Post date:** [November 1, 2018, 6:02pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/15 "2018-11-01T18:02:26Z")

</div>

When I copy the invoke into my test component it works just fine with the identical arguments so I can’t see them being wrong?

I have a log message before the invoke, which appears, so the “Email State” is activating, but the invoke is not opening (as the log message right at the start of it doesn’t appear).

A work around could be not to use arguments and just invoke the “initialise settings” activity within the email component to get the config info in, then assign them inside the component? I’d rather understand why the identical invoke works for you and my test environment, but not in the main project…

---

<div class="post-metadata">

**Author:** ![nadim.warsi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nadim.warsi/32/30741_2.png) [@nadim.warsi](https://forum.uipath.com/u/nadim.warsi)\
**Post date:** [November 1, 2018, 6:10pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/16 "2018-11-01T18:10:03Z")

</div>

I believe the issue is now different. Your invoke dosent work.

i dont think that the issue is with the config variables.  
It will just fetch you the values, given that your config is having those fields.  
can you share what your config looks like for these fields? You can mask confidential details.

---

<div class="post-metadata">

**Author:** ![Alex\_Cross](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alex_cross/32/30532_2.png) [@Alex\_Cross](https://forum.uipath.com/u/Alex_Cross)\
**Post date:** [November 1, 2018, 6:13pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/17 "2018-11-01T18:13:56Z")

</div>

![image](https://global.discourse-cdn.com/uipath/original/3X/d/0/d0233bacd7354ea85c36cb65a43697c63312e6c9.png)

I have filtered as well, to show just the relevant ones, actual config file isn’t filtered.  
These work just fine in the test component.

---

<div class="post-metadata">

**Author:** ![nadim.warsi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nadim.warsi/32/30741_2.png) [@nadim.warsi](https://forum.uipath.com/u/nadim.warsi)\
**Post date:** [November 1, 2018, 6:16pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/18 "2018-11-01T18:16:09Z")

</div>

Your config looks good.  
Have you tried to debug as to why the invoke is broken?  
Are you getting any different error now? or still the smtp erro?

---

<div class="post-metadata">

**Author:** ![Alex\_Cross](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alex_cross/32/30532_2.png) [@Alex\_Cross](https://forum.uipath.com/u/Alex_Cross)\
**Post date:** [November 1, 2018, 6:17pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/19 "2018-11-01T18:17:13Z")

</div>

Still the same error, and debug in test mode works fine. In project it looks like it just stops at the invoke with the same error?

I also deleted and recreated the invoke from scratch in case it was being funny for that reason, but it made no difference.

---

<div class="post-metadata">

**Author:** ![nadim.warsi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nadim.warsi/32/30741_2.png) [@nadim.warsi](https://forum.uipath.com/u/nadim.warsi)\
**Post date:** [November 1, 2018, 6:19pm UTC](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344/20 "2018-11-01T18:19:06Z")

</div>

> [@Alex\_Cross](#):
>
> Still the same error, and debug in test mode works fine. In project it looks like it just stops at the invoke with the same error?

it goes inside your workflow?

[Next page](https://forum.uipath.com/t/invoke-workflow-arguments-error/73344.md?page=2)
