> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ja/llms.txt # Run.restart() `.restart()` メソッドは、サーバーとの接続が失われたアクティブな Workflow Run を再起動し、接続が失われた時点(最後にアクティブだったステップ)から実行を続行できるようにします。 ## 使用例 ```typescript const run = await workflow.createRun() const result = await run.start({ inputData: { value: 'initial data' } }) const restartedResult = await run.restart() ``` ## パラメーター **requestContext** (`RequestContext`): 再開時に使用する Request Context データ **tracingContext** (`TracingContext`): 子 span の作成と metadata の追加に使用する Tracing context。Mastra の tracing system を使用すると自動的に挿入されます。 **tracingContext.currentSpan** (`Span`): 子 span の作成と metadata の追加に使用する現在の span。実行中にカスタムの子 span を作成したり、span attribute を更新したりするために使用します。 **tracingOptions** (`TracingOptions`): Tracing 設定のオプション。 **tracingOptions.metadata** (`Record`): ルート trace span に追加する metadata。ユーザー ID、セッション ID、feature flag などのカスタム属性を追加する場合に役立ちます。 **tracingOptions.requestContextKeys** (`string[]`): この trace の metadata として抽出する追加の RequestContext キー。ネストされた値にはドット記法(例: 'user.id')を使用できます。 **tracingOptions.traceId** (`string`): この実行に使用する trace ID(1〜32 文字の 16 進数)。指定すると、この trace は指定した trace の一部になります。 **tracingOptions.parentSpanId** (`string`): この実行に使用する親 span ID(1〜16 文字の 16 進数)。指定すると、ルート span はこの span の子として作成されます。 **tracingOptions.tags** (`string[]`): この trace に適用する tag。trace の分類とフィルタリングに使用する文字列ラベルです。 ## 戻り値 **result** (`Promise>`): ステップの出力とステータスを含む Workflow の実行結果で解決される Promise **traceId** (`string`): Tracing が有効な場合に、この実行に関連付けられる trace ID。ログの関連付けや実行フローのデバッグに使用します。 **spanId** (`string`): Tracing が有効な場合に、この実行に関連付けられるルート span ID。span 単位の検索と関連付けに使用します。 ## 関連項目 - [Workflow の概要](https://mastra.zisheng.pro/ja/docs/workflows/overview) - [Workflow を再起動する](https://mastra.zisheng.pro/ja/docs/workflows/overview) - [Workflow.createRun()](https://mastra.zisheng.pro/ja/reference/workflows/workflow-methods/create-run)