BookmarkSubscribeRSS Feed
Sonali4
Calcite | Level 5

Hello SAS Community,

I’m trying to create flows into SAS Viya 4 through the API. I can successfully authenticate and reach the Viya environment, but I’m looking for the correct creation pattern for flows in Viya 4 and any best practices for packaging the payload.

Specifically, I’d appreciate guidance on:

  • The recommended API endpoint for importing flows in Viya 4
  • The expected request shape or payload format
  • Any differences between creating flows and scenarios through the API
  • Whether there are any sample requests or documentation you recommend

If anyone has done this before, I’d be grateful for examples or advice on the most reliable approach.

Thank you.

1 REPLY 1
CaseySmith
SAS Employee

Hi @Sonali4!

Thank you for your questions. I assume you mean flows in SAS Studio, but if you meant something else (like Job Flows in Environment Manager), please let us know. I was also a little unsure of whether you truly meant "importing" (the word you used in the title) an existing SAS Studio flow or creating a flow from scratch using an API, but no worries -- I'll try to answer both...

 

Currently, there are no public APIs for creating a SAS Studio flow from scratch. Rather, SAS Studio uses an internal dataFlows service for working with flows. The only related public API is SAS Studio Development, which currently only has one endpoint for generating the code that Studio would run for a program or a flow.

 

We are working toward exposing more SAS Studio capabilities programmatically, including flow building, which will eventually also be able to be driven by AI agents. But in the meantime, if you want to programmatically create a flow, though not an official recommendation, your best bet for now is to manually build one flow in SAS Studio, download it as a .flw file, inspect the json format inside of it, then write code to generate desired .flw files in the same format.

 

If you were wanting to automate "importing" existing flows into SAS Studio, if you plan to store the .flw files in SAS Server, you don't really need to import them at all. Rather, you just move the .flw files to mounted storage which is accessible to your Viya 4 deployment. Then in SAS Studio, the flow (.flw) files will appear in the mount under SAS Server and you can open, edit, and run them from there. If you are wanting to store them in SAS Content, there is an additional step needed to register them in the dataFlow service. SAS Studio performs this step for you when you manually upload a .flw file to SAS Content in SAS Studio. Again though, the dataFlow service is not a public API.

 

Hope this helps.

 

Casey


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 421 views
  • 0 likes
  • 2 in conversation