Workflows
Overview
The Engagespot CLI provides commands to manage workflows across environments, allowing developers to:
- List all workflows from the engagespot server.
 - Pull workflows from the server to the local machine.
 - Push workflows from the local machine to the engagespot server.
 
This documentation explains how to use these commands effectively.
Listing Workflows
To list all workflows in a specific environment, use the following command:
engagespot workflow list -e <environment>
Description:
- Purpose: This command lists all workflows available in the specified environment on the Engagespot server.
 - Parameters:
-e <environment>: A mandatory parameter that specifies the environment from which to list the workflows (e.g.,development,staging, orproduction).
 - Output: The CLI displays a table of workflows, including details such as ID, identifier, name, active status, creation date, unpublished changes status, and category name.
 
Example:
$ engagespot workflow list -e development
Workflows fetched successfully
Pulling Workflows
To pull workflows from the server to the local machine, use the following command:
engagespot workflow pull -e <environment> [-i <identifier>]
Description:
- Purpose: This command pulls workflows from the specified environment on the server to your local machine, creating a local copy.
 - Parameters:
-e <environment>: A mandatory parameter to specify the environment from which the workflows should be pulled.-i <identifier>: (Optional) Specifies the workflow identifier. If not provided, all workflows will be pulled.
 - Output: The CLI pulls the selected workflows and stores them in the 
engagespot/workflowsdirectory on your local machine. If workflows with the same identifiers exist locally, the command will ask for confirmation before overriding them. 
Example:
$ engagespot workflow pull -e development -i "notification_workflow"
Confirmation:
Pulling workflows will override any local changes that are made to the workflows with the same identifiers. Are you sure you want to continue? (y/N)
Pushing Workflows
To push workflows from your local machine to the server, use the following command:
engagespot workflow push -e <environment> [-i <identifier>]
Description:
- Purpose: This command pushes local workflow files to the specified environment on the Engagespot server.
 - Parameters:
-e <environment>: A mandatory parameter to specify the environment to which the workflows should be pushed.-i <identifier>: (Optional) Specifies the workflow identifier. If not provided, all workflows from the local directory will be pushed.
 - Output: The CLI uploads the local workflows to the Engagespot server and provides a success message upon completion.
 
Example:
$ engagespot workflow push -e development -i "notification_workflow"
Example Scenarios
- 
Scenario: Listing Workflows in a Development Environment
- Run 
engagespot workflow list -e developmentto list all workflows in the development environment. 
 - Run 
 - 
Scenario: Pulling a Specific Workflow
- To pull a single workflow from the staging environment, use 
engagespot workflow pull -e staging -i "welcome_email". 
 - To pull a single workflow from the staging environment, use 
 - 
Scenario: Pushing All Local Workflows
- After editing workflows locally, push them to the production environment with 
engagespot workflow push -e production. 
 - After editing workflows locally, push them to the production environment with