Position check fails if I have no open position for a symbol

I am writing a automate flow, similar to below..

I select the symbol from webhook. say natagmini and tradingview_lot as 8

case 1

if I have any open position in symbol natagmini current expiry.. ( say 2 bullish , could be created manually)
then want to sell 2 lots from current expiry and 6 lots from next expiry.

case 2

and if I do not have any open position… in symbol natagmini current expiry ( say 0)
then i want to sell 8 lots from next expiry.

Note:- I can always have other open positions like Cruide oils or other

My current flow works fine in case 1,

but case 2 execution fails, with error.. because positionOfsymbol check simply fails if there is no position.
and we do not have any guard/ conditon check possible to check if a open position exisits for particular symbol in my portfolio …

Suggestion/Improvement
Solution 1:- ( solves this particular problem , could be a WA or qucik solution without huge design change)
`positionOfsymbol ` if no position exists should still return a position with quanity 0, price 0 etc…
so a guard /check can be added to see if I actually have the position.

Solution 2 ( better overall design but complex, but handles it for any other cases across actions) :- with Yes and No output for If condition, (or for any action,) add a new path Error..
if any error occurs, new error path if configured will execute.

like say :- order placement, if success then do something, target price do something, sl do something, order placement fails( new error path) , do something else

if failed to get position of symbols, thats a error for the expression/if condition.. on error, do some other flow..

Please fix this its very important .

@FYERS-Team

Sorry to tag you all, but its really blockng my automated orders.

Can you please check above case.

Do let me know if you need any further input to describe the issue.

“workflow_id”: “38d13fa3-aa5f-499d-a3a2-10414932b909”,

“automation failed at node IF3. Message : run nested pipeline for “QueryBuilder0”: item 1 expression failed: eval expression: Position_of_symbol: symbol “MCX:NATGASMINI26OCTFUT” not found”,

“executed_at”: “1793084472324”,

“strategy_name”: “TRADINGVIEW_RENKO_SELL”,

Hi @105948276675273746039, as a workaround, you can use the Portfolio Check node to check the count of open positions. If the count is 0, you can use an IF block to proceed with the strategy.

Please note that this checks the overall open position count, not the position for a specific symbol. So, if you have open positions in other symbols, this workaround may not work as expected.

We’ve also noted your feedback on adding a symbol-specific position check and will take it into consideration for future improvements. Thanks for sharing your suggestions!