-
Notifications
You must be signed in to change notification settings - Fork 35
Quick Start
Welcome to Synapse! This guide will walk you through the steps to create and run your first workflow using Synapse. By following these steps, you'll get a basic workflow up and running in no time.
Ensure you have the following installed and set up:
- Synapse (using Docker, Kubernetes, or directly via .NET binaries)
-
synctl
CLI (installed and configured)
Create a YAML file that defines a simple workflow. For this example, we'll use a workflow named greeter
that returns a greeting message.
-
Create a file named
greeter.yaml
:document: dsl: '1.0.0' name: greeter namespace: default version: '0.1.0' do: - greet: set: greetings: '${ "Hello \(.user.firstName) \(.user.lastName)!" }'
This file defines a workflow with a single task that sets a greeting message based on input.
Use synctl
to create the workflow in Synapse.
-
Run the following command:
synctl workflow create -f greeter.yaml
This command uploads the
greeter.yaml
definition to the Synapse API and creates the workflow.
Now, let's execute the workflow with sample input to see how it works.
-
Prepare the input YAML file,
input.yaml
:user: firstName: John lastName: Doe
-
Run the workflow with the input file:
synctl workflow run greeter --namespace default --version 0.1.0 --input input.yaml
This command triggers the
greeter
workflow with the provided input. The output will include the results of the workflow execution.
After the workflow completes, you can retrieve the output to see the result of the execution.
-
Get the output of the workflow instance:
synctl workflow-instance get-output <workflow-instance-id> --namespace default --output yaml
Replace
<workflow-instance-id>
with the ID of the workflow instance obtained from the run command.
You have successfully:
- Defined a simple workflow using Synapse.
- Created the workflow using the
synctl
CLI. - Ran the workflow with sample YAML input.
- Retrieved the output to verify the result.
- Explore More Workflow Examples: Learn about more complex workflows and how to define them.
- API Documentation: Get detailed information on API endpoints for further integration.
For additional help, refer to the troubleshooting guide or join the discussion on the GitHub discussions page.