@@ -153,18 +153,26 @@ export const asyncLocalStorage: AsyncLocalStorage<Context> = (globalThis as any)
153153 * Holds information about the current Activity Execution. Retrieved inside an Activity with `Context.current().info`.
154154 */
155155export interface Info {
156+ /**
157+ * Task token associated with this activity execution. Can be used for asynchronous completion
158+ */
156159 readonly taskToken : Uint8Array ;
157160 /**
158- * Base64 encoded ` taskToken`
161+ * Base64 encoded { @link taskToken}
159162 */
160163 readonly base64TaskToken : string ;
164+ /**
165+ * ID of this activity
166+ */
161167 readonly activityId : string ;
162168 /**
163169 * Exposed Activity function name
164170 */
165171 readonly activityType : string ;
166172 /**
167173 * The namespace this Activity is running in
174+ *
175+ * @deprecated Use {@link namespace} instead
168176 */
169177 readonly activityNamespace : string ;
170178 /**
@@ -176,20 +184,22 @@ export interface Info {
176184 */
177185 readonly isLocal : boolean ;
178186 /**
179- * Information about the Workflow that scheduled the Activity
187+ * Information about the Workflow that scheduled the Activity. Not set if the activity was not started by a Workflow
180188 */
181- readonly workflowExecution : {
189+ readonly workflowExecution ? : {
182190 readonly workflowId : string ;
183191 readonly runId : string ;
184192 } ;
185193 /**
186- * The namespace of the Workflow that scheduled this Activity
194+ * The namespace of the Workflow that scheduled this Activity. Not set if the activity was not started by a Workflow
195+ *
196+ * @deprecated Use {@link namespace} instead
187197 */
188- readonly workflowNamespace : string ;
198+ readonly workflowNamespace ? : string ;
189199 /**
190- * The module name of the Workflow that scheduled this Activity
200+ * The module name of the Workflow that scheduled this Activity. Not set if the activity was not started by a Workflow
191201 */
192- readonly workflowType : string ;
202+ readonly workflowType ? : string ;
193203 /**
194204 * Timestamp for when this Activity was first scheduled.
195205 * For retries, this will have the timestamp of the first attempt.
@@ -249,6 +259,24 @@ export interface Info {
249259 * version), but it may still be defined server-side.
250260 */
251261 readonly retryPolicy ?: RetryPolicy ;
262+ /**
263+ * The namespace this Activity is running in
264+ */
265+ readonly namespace : string ;
266+ /**
267+ * ID of the current run of this activity. Can be used to differentiate between different activity executions that
268+ * share the same ID. Activities started by a Workflow don't have activity run ID - instead, they can be identified by
269+ * workflow ID and workflow run ID; see {@link workflowExecution}
270+ *
271+ * @experimental Standalone Activities are experimental. APIs may be subject to change.
272+ */
273+ readonly activityRunId ?: string ;
274+ /**
275+ * Whether this activity was started by a workflow
276+ *
277+ * @experimental Standalone Activities are experimental. APIs may be subject to change.
278+ */
279+ readonly inWorkflow : boolean ;
252280}
253281
254282/**
0 commit comments