You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vscode-debugger-extension/README.md
+68-95Lines changed: 68 additions & 95 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,22 +41,42 @@ To connect to a different Server:
41
41
- Edit the `Address` field
42
42
- If you're using TLS (e.g. to connect to Temporal Cloud), check the box and select your client cert and key
43
43
44
-
### Entrypoint
44
+
### Examples
45
45
46
46
#### TypeScript
47
47
48
-
By default, the extension will look for the file that calls the TypeScript replayer adapter at `src/debug-replayer.ts`. To use a different TypeScript or JavaScript file, set the `temporal.replayerEntryPoint` config:
48
+
Create a small `replayer.ts` in your project that runs the Tyepscript replayer adapter in IDE mode and registers your workflow function, for example:
@@ -86,11 +101,25 @@ if (require.main === module) {
86
101
}
87
102
```
88
103
104
+
5. Open or create `.vscode/settings.json` and add the config field:
105
+
106
+
```json
107
+
{
108
+
"temporal.replayerEntryPoint": "replayer.ts"
109
+
}
110
+
```
111
+
89
112
_Note that the file must be within your project directory so it can find `node_modules/`._
90
113
91
114
#### Go
92
115
93
-
Go entrypoints are started via the background process. Create a small `main.go` in your project that runs the Go replayer adapter in IDE mode and registers your workflow function, for example:
116
+
1. Get the replayer code
117
+
118
+
```
119
+
go get -u github.com/phuongdnguyen/temporal-workflow-debugger/replayer-adapter-go@latest
120
+
```
121
+
122
+
2. Create a small `main.go` in your project that runs the Go replayer adapter in IDE mode and registers your workflow function, for example:
94
123
95
124
```go
96
125
package main
@@ -112,22 +141,30 @@ func main() {
112
141
}
113
142
```
114
143
115
-
Configure the background process to run `tdlv` which builds and runs your entrypoint under Delve and exposes a DAP proxy on port 60000. Set `cwd` to the folder that contains your `package main` (the entrypoint):
The extension automatically attaches to the proxy. If your workspace root is the Go module, you may omit `options.cwd`.
153
+
4. Run "Temporal: Open Panel"
154
+
5. Enter a Workflow Id or choose a history JSON file
155
+
6. Click `Load History`
156
+
7. Select history events that you want the workflow to be stopped on
157
+
8. Hit `Start debug session`
127
158
128
159
#### Python
129
160
130
-
Python entrypoints are also started via the background process. Create a small script (e.g. `vscode-replay.py`) that uses the Python replayer adapter in IDE mode and references your workflow:
161
+
1. Make sure your Python environment has the required dependencies installed:
162
+
163
+
```bash
164
+
pip install temporalio replayer-adapter-python
165
+
```
166
+
167
+
2. Create a small script (e.g. `replayer.py`) that uses the Python replayer adapter in IDE mode and references your workflow:
131
168
132
169
```python
133
170
import asyncio
@@ -155,83 +192,19 @@ if __name__ == "__main__":
155
192
asyncio.run(main())
156
193
```
157
194
158
-
Configure the background process to start `tdlv` for Python and point it at your entrypoint script (DebugPy will be launched by `tdlv` and proxied via port 60000):
Make sure your Python environment has the required dependencies installed:
175
-
176
-
```bash
177
-
pip install temporalio replayer-adapter-python
178
-
```
179
-
180
-
### Languages
181
-
182
-
You can choose which language to debug via the `temporal.debugLanguage` setting. Supported values:
183
-
184
-
-`typescript` (default)
185
-
-`go`
186
-
-`java`
187
-
-`python`
188
-
189
-
Set it in your workspace settings:
190
-
191
-
```json
192
-
{
193
-
"temporal.debugLanguage": "go"
200
+
"temporal.replayerEntryPoint": "replayer.py"
201
+
// If you want use a custom python rather the one in PATH
202
+
// "temporal.python": "/Your/path/to/python"
194
203
}
195
204
```
196
205
197
-
### Background Process
198
-
199
-
The extension supports running a background process before starting the debug session. This process will be automatically terminated when the debug session ends.
- Running setup scripts or initialization processes
220
-
221
-
The extension uses graceful termination (SIGTERM) first, then forceful termination (SIGKILL) if needed. Process output is logged to the VS Code console.
222
-
223
-
### Adapter integration (IDE server)
224
-
225
-
When a history is loaded in the panel, the extension starts a local server used by language adapters:
226
-
227
-
- Address: `http://127.0.0.1:54578`
228
-
- Endpoints:
229
-
-`GET /history` – returns the workflow history (JSON bytes)
230
-
-`GET /breakpoints` – returns the enabled breakpoint event IDs
231
-
-`POST /current-event` – highlight the current event in the UI
232
-
233
-
Adapters may honor the `WFDBG_HISTORY_PORT` environment variable to override the default port.
234
-
235
-
Notes:
236
-
237
-
- Only Workflow code executes during replay; Activity code isn’t run (effects are driven by history).
206
+
4. Run "Temporal: Open Panel"
207
+
5. Enter a Workflow Id or choose a history JSON file
208
+
6. Click `Load History`
209
+
7. Select history events that you want the workflow to be stopped on
0 commit comments