Can we create flow using script

Not applicable

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

Not applicable

Yes, I know that, but is it possible to create a flow with scripting or not?

I doubt we can set trigger conditions or how to map your scriptred trigger conditions 

Ankur Bawiskar
Tera Patron

@Community Alums 

I never came across any customer requirement to create a flow from script.

Flows are meant for low-code, no-code requirements and if you are creating flow using script then I think it's not recommended.

Flows are meant to be created from UI.

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏

Not applicable

Yes, I know that, but I wanted to know that is it possible to create a flow with scripting or not?

Tanushree Maiti
Tera Patron

Hi @Community Alums 

 

Can you validate your requirement again- is it call flow from script OR create flow using script?

 

Flows are intended to provide a low-code way of designing and managing process logic. If an entire flow could be created through scripting alone, it would undermine the purpose of having a flow designer. Therefore, while scripts can be used for specific actions or to trigger flows, the overall flow structure is expected to be built and maintained through the visual designer.

 

You can’t build a complete flow solely through server-side scripting, since the flow structure depends on the visual logic designer.

However, you can use scripts to automate specific actions within a flow or to trigger flows programmatically.