Skip to main content
The goal of this first step is to familiarize yourself with implementing actions and effects from scratch. The specifications of the workflow are available bellow.

Orders management - Specifications

If you are not familiar with the specifications, you can refer to the specification documentation.

Starting the development

Requirements

To generate a workflow, you’ll need to have the following tools installed: Install yarn if you don’t have it already:
You’ll generate with the Stratumn CLI. It comes from our private npm registry, like the @stratumn packages of the exercise, so npm needs a token first. Create a personal access token with the api scope on git.sia.partners, under User settings → Access tokens, and add it to your ~/.npmrc:
Then install it and log in to staging:
You need version 1.2.1 or later: check with stratumn --version. Once you’re logged in, ask your onboarding buddy (or anyone who is a superuser on staging) to give you the developer role. It’s the “developer role” switch next to your name in your organization’s members, on account.staging.stratumn.com. You can’t generate without it, so ask on day one.

Stratumn CLI - Getting started

Setup the project

Clone the repository and open it in Vim your favorite IDE.

Orders management - Repository

Create a new branch for your changes:
Now, you’ll need to install the dependencies:

Generating the workflow

While developing, you’ll be generating in the staging environment. You generate with your own account, thanks to the developer role you asked for above. No admin password needed. In the .env.local-to-staging file, replace REPLACE_ME_AFTER_FIRST_GENERATION in the WORKFLOWS variable with an empty string: WORKFLOWS='{"ordersManagement":""}'. Your workflow will be named ⚒️ Orders Management - <your git user.name>, so you can find yours in staging. If git has no user.name yet, run git config --global user.name "Your Name". To use another name, set YOUR_NAME in the same file. To generate the workflow, run the following command at the root of the project:
It asks you to confirm the environment and the account, then runs the project’s generate:local-to-staging script as you. Add --dry-run first to see the script and the .env file it will use, without generating. If it refuses, its message says what to fix. The CLI guide lists the usual cases.
When generating for the first time a workflow, you will create a new ID. This ID will be displayed in the console, after # in the “Built workflows” summary. Copy this ID and use it to update the WORKFLOWS variable in the .env.local-to-staging file, for example WORKFLOWS='{"ordersManagement":"1838"}'. You’ll need to run the generation command again for it to be fully functional. The summary prints no link for this environment: use the URL below.
That’s it! You’ve generated your first workflow 🚀 Check it in the staging environment at https://trace.staging.stratumn.com/workflow/your_workflow_id