diff --git a/writerside/topics/Loading-Workflows-from-JSON.topic b/writerside/topics/Loading-Workflows-from-JSON.topic index 73768e6..ce5f69e 100644 --- a/writerside/topics/Loading-Workflows-from-JSON.topic +++ b/writerside/topics/Loading-Workflows-from-JSON.topic @@ -44,6 +44,35 @@ + + +

When you're hosting an Elsa Server, providing workflows from JSON files is even easier.

+

All you need to do then is create a folder called Workflows and add any number of workflow JSON files to it.

+

Let's try it out:

+ + Setup an Elsa Server project. + Create a new folder called Workflows + + Create a new file called HelloWorld.json in the root of the project and make sure it is configured to be copied to the output directory. + HelloWorld.json + + + +

Run the application using the following command:

+ + dotnet run --urls "https://localhost:5001" + +
+ +

Execute the workflow using the following curl:

+ + curl --location --request POST 'https://localhost:5001/elsa/api/workflow-definitions/HelloWorld/execute' \ + --header 'Authorization: ApiKey {your-api-key}' + +

Alternatively, start ab Elsa Studio container and run the workflow from there

+
+
+

In this guide, we have seen how to load a JSON file and deserialize it into a Workflow class and then execute it.