> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ja/llms.txt # Run.start() `.start()` メソッドは入力データを使用して Workflow Run を開始し、Workflow を最初から実行できるようにします。 ## 使用例 ```typescript const run = await workflow.createRun() const result = await run.start({ inputData: { value: 'initial data', }, }) ``` ## パラメーター **inputData** (`z.infer`): Workflow の入力スキーマに一致する入力データ **requestContext** (`RequestContext`): Workflow の実行中に使用する Request Context データ **outputWriter** (`(chunk: TOutput) => Promise`): 生成された出力チャンクを処理する任意の非同期関数 **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 の分類とフィルタリングに使用する文字列ラベルです。 **outputOptions** (`OutputOptions`): 出力設定のオプション。 **outputOptions.includeState** (`boolean`): 結果に Workflow Run の状態を含めるかどうか。 ## 戻り値 **result** (`Promise>`): ステップの出力とステータスを含む Workflow の実行結果で解決される Promise **traceId** (`string`): Tracing が有効な場合に、この実行に関連付けられる trace ID。ログの関連付けや実行フローのデバッグに使用します。 **spanId** (`string`): Tracing が有効な場合に、この実行に関連付けられるルート span ID。span 単位の検索と関連付けに使用します。 ## その他の使用例 ```typescript import { RequestContext } from '@mastra/core/request-context' const run = await workflow.createRun() const requestContext = new RequestContext() requestContext.set('variable', false) const result = await run.start({ inputData: { value: 'initial data', }, requestContext, }) ``` ## 関連項目 - [Workflow の概要](https://mastra.zisheng.pro/ja/docs/workflows/overview) - [Workflow.createRun()](https://mastra.zisheng.pro/ja/reference/workflows/workflow-methods/create-run)