Skip to content

Commit c215204

Browse files
committed
docs: update guide sidebars
1 parent 9b338c4 commit c215204

File tree

4 files changed

+24
-38
lines changed

4 files changed

+24
-38
lines changed

docs/_sidebar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
- User guides
66

7-
- [Customizing the TUI](guide/interactive.md "Customizing the interactive UI")
87
- [Secrets vault](guide/secret.md "Using the secrets vault")
98
- [Workspaces](guide/workspace.md "Managing workspaces")
109
- [Executables](guide/executable.md "Managing executables")
1110
- [Templating](guide/templating.md "Using flowfile templates")
1211
- [Managing state](guide/state.md "Managing executable state")
1312
- [Conditional execution](guide/conditional.md "Conditional execution")
13+
- [Customizing the TUI](guide/interactive.md "Customizing the interactive UI")
1414

1515
- Reference
1616

docs/guide/_sidebar.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
- [Quick start](../quickstart.md "Quick start guide")
44

55
- User guides
6-
- [Customizing the TUI](interactive.md "Customizing the interactive UI")
76
- [Secrets vault](secret.md "Using the secrets vault")
87
- [Workspaces](workspace.md "Managing workspaces")
98
- [Executables](executable.md "Managing executables")
109
- [Templating](templating.md "Using flowfile templates")
11-
- [Managing state](guide/state.md "Managing executable state")
12-
- [Conditional execution](guide/conditional.md "Conditional execution")
10+
- [Managing state](state.md "Managing executable state")
11+
- [Conditional execution](conditional.md "Conditional execution")
12+
- [Customizing the TUI](interactive.md "Customizing the interactive UI")
1313

docs/guide/conditional.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Conditional Expressions
1+
## Conditional Expressions
22

33
flow CLI uses conditional expressions to control [executable](executable.md) behavior based on runtime conditions. These expressions are written
44
using a simple expression language that provides access to system information, environment variables, and stored data.
55

6-
## Expression Language
6+
### Expression Language
77

88
Flow uses the [Expr](https://expr-lang.org) language for evaluating conditions. The language supports common
99
operators and functions while providing access to flow executable-specific context data.
1010

1111
**See the [Expr language documentation](https://expr-lang.org/docs/language-definition) for more information on the
1212
expression syntax.**
1313

14-
### Basic Operators
14+
#### Basic Operators
1515

1616
The expression language supports standard comparison and logical operators:
1717

@@ -20,7 +20,7 @@ The expression language supports standard comparison and logical operators:
2020
- String: `+` (concatenation), `matches` (regex matching)
2121
- Length: `len()`
2222

23-
### Available Context
23+
#### Available Context
2424

2525
When writing conditions, you have access to several context variables:
2626

@@ -35,12 +35,12 @@ When writing conditions, you have access to several context variables:
3535
- `store`: Key-value map of data store contents
3636
- `env`: Map of environment variables
3737

38-
## Writing Conditions
38+
### Writing Conditions
3939

4040
Conditions can be used in various places within flow, most commonly in the `if` field of executable configurations. Here are
4141
some examples of common conditional patterns:
4242

43-
### Operating System and Architecture Checks
43+
#### Operating System and Architecture Checks
4444

4545
Check for specific operating systems or architectures:
4646

@@ -60,7 +60,7 @@ executables:
6060
cmd: make build-arm64
6161
```
6262
63-
### Environment Variable Checks
63+
#### Environment Variable Checks
6464
6565
Make decisions based on environment variables:
6666
@@ -76,7 +76,7 @@ executables:
7676
cmd: echo "Debug mode enabled"
7777
```
7878
79-
### Data Store Conditions
79+
#### Data Store Conditions
8080
8181
Use stored data to control execution:
8282
@@ -93,7 +93,7 @@ executables:
9393
cmd: echo "Optional key exists"
9494
```
9595
96-
### Complex Conditions
96+
#### Complex Conditions
9797
9898
Combine multiple conditions using logical operators:
9999
@@ -109,7 +109,7 @@ executables:
109109
cmd: echo "Valid build on Unix-like system"
110110
```
111111
112-
### Path and Location Checks
112+
#### Path and Location Checks
113113
114114
Use context information to make path-based decisions:
115115

docs/guide/state.md

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# State Management
1+
## State Management
22

33
flow provides several mechanisms for managing state across [executable](executable.md) runs. This guide explores how to use the data store
44
and temporary directories to maintain state, as well as how to make execution decisions based on that state.
55

6-
## Data Store
6+
### Data Store
77

88
The data store is a key-value store that persists data across executions. It provides a simple way to share information
99
between executables and maintain state between runs.
1010

11-
### Store Persistence Scope
11+
#### Store Persistence Scope
1212

1313
Values in the data store have different persistence scopes depending on where they are set:
1414

1515
- Values set outside an executable (using the CLI directly) persist across all executions until explicitly cleared
1616
- Values set within an executable persist only across that executable's sub-executables (both serial and parallel)
1717
- All values set within an executable are automatically cleared when the parent executable completes
1818

19-
### Managing Store Data
19+
#### Managing Store Data
2020

2121
The data store can be managed at a global level in the CLI and within an executable's script. Here are the key operations:
2222

@@ -51,7 +51,7 @@ flow store clear
5151
flow store clear --full
5252
```
5353

54-
### Using the Store in Executables
54+
#### Using the Store in Executables
5555

5656
Here's an example of how to use the data store within an executable:
5757

@@ -73,7 +73,7 @@ executables:
7373
echo "Last run: $(flow store get last-run)"
7474
```
7575
76-
### Store-Based Conditional Execution
76+
#### Store-Based Conditional Execution
7777
7878
The data store's contents can be accessed in executable `if` conditions using the `data` context variable. This allows for
7979
dynamic execution paths based on stored values:
@@ -95,12 +95,12 @@ executables:
9595

9696
See the [Conditional Execution](conditional.md) guide for more examples of using conditions in Flow.
9797

98-
## Temporary Directories
98+
### Temporary Directories
9999

100100
Flow provides a special directory reference `f:tmp` that creates an isolated temporary directory for an executable. This
101101
directory is automatically cleaned up when the executable completes.
102102

103-
### Using Temporary Directories
103+
#### Using Temporary Directories
104104

105105
To use a temporary directory, set the `dir` field in your executable configuration:
106106

@@ -116,7 +116,7 @@ executables:
116116
make build
117117
```
118118

119-
### Sharing Temporary Files
119+
#### Sharing Temporary Files
120120

121121
While temporary directories are isolated, you can share files between steps in a serial or parallel executable by using
122122
the same temporary directory:
@@ -133,7 +133,7 @@ executables:
133133
- cmd: cat output.txt
134134
```
135135

136-
## Combining State Management Approaches
136+
### Combining State Management Approaches
137137

138138
The data store and temporary directories can be used together for more complex state management:
139139

@@ -157,17 +157,3 @@ executables:
157157
- if: data["cleanup-enabled"] == "true"
158158
cmd: make clean
159159
```
160-
161-
### Best Practices
162-
163-
When managing state in Flow, consider the following:
164-
165-
1. Use the data store for:
166-
- Sharing simple key-value data between executables
167-
- Storing configuration that needs to persist between runs
168-
- Managing feature flags and conditional execution
169-
170-
2. Use temporary directories for:
171-
- Build and compilation workspaces
172-
- Processing temporary files
173-
- Isolating file operations between different executions

0 commit comments

Comments
 (0)