Can we create flow using script

VaibhavP5059517
Giga Guru

Hey All,
I wanted to know that can we create flow using script in ServiceNow and which table stores which part of flow.

1 ACCEPTED SOLUTION

Diogo Ramos
Tera Sage

Hey, going directly to your question, yes you can create a flow via code, but this has to be done via the now SDK as far as I am aware, you cannot just run a script in SN and create a flow at least in a easy way.

From SDKK 4.3.0 you normally have access to the fluent FLOW API , meaning you can also use AI to generate these flows. sdk-examples/flow-sample/src/fluent/flow-trigger-catalog-item.now.ts at main · ServiceNow/sdk-exampl...

I Hope this helps !

View solution in original post

23 REPLIES 23

hey @Priyam Sharma ,
But I haven't asked for triggering or executing flow, I have asked for flow creation through scripting.

PradeepReddyA
Tera Guru

Hi @VaibhavP5059517 

 

Instead of building the functionality from scratch, you could invoke the existing Flow from the script. Could you please clarify the exact business requirement and the expected outcome?

Hope that Helps!

Hey @PradeepReddyA ,
If I wouldn't build the flow, how will it exist and how can I invoke it, please go through the question again, I am asking flow creation through script not triggering the flow through script.

Diogo Ramos
Tera Sage

Hey, going directly to your question, yes you can create a flow via code, but this has to be done via the now SDK as far as I am aware, you cannot just run a script in SN and create a flow at least in a easy way.

From SDKK 4.3.0 you normally have access to the fluent FLOW API , meaning you can also use AI to generate these flows. sdk-examples/flow-sample/src/fluent/flow-trigger-catalog-item.now.ts at main · ServiceNow/sdk-exampl...

I Hope this helps !