# Context Information

The *Context Information* object in Astera provides a set of context information parameters that take their values at runtime of a dataflow or workflow. These parameters include several details related to the job taking place and the server on which it is being run, such as *ServerName*, *JobId*, *UserName*, and *DroppedFilePath*, among others.

### Use Case

In this use case, we will automate the process of writing a fictitious organization’s customer data, which is currently available in an Excel format, to a database table. The source data is stored in multiple Excel files, and each of these files will be dropped into a particular folder. Our goal is to design a process where customer data is extracted from every file that is dropped into the folder, and then written to a destination table without any manual intervention. For this, we will be using the *DroppedFilePath* parameter in the *Context Information* object, in conjunction with the *When File is Dropped* option in the Astera *Job Scheduler.*

### Using the Context Information Object in Astera&#x20;

We have already designed a dataflow to create the process of writing data to a destination table, and we will orchestrate this process for automation in a workflow.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/lWEcmE4WWhY4Ddebx1Jd/01-context-information-dataflow.PNG)

In the dataflow, we have used an [*Excel Workbook Source* ](https://documentation.astera.com/dataflows/sources/excel-workbook-source)object to extract data from the source files, and a [*Database Table Destination*](https://documentation.astera.com/dataflows/destinations/database-table-destination) object to write this data to a database table. A *Variables* object has been used to create a variable that will provide source file paths to the *Excel Workbook Source* object.

On the *Variables Properties* screen of the *Variables* object, you will see that we have created an input variable, *FilePath*.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/cBDBgfnDSvOl4jaxVGzo/02-context-information-variable-filepath.PNG)

We have used this variable as an input parameter for the *FilePath* section in the *Config Parameters* screen of the *Excel Workbook Source* object.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/KvPI1WURZ0CfLsxKJF55/03-context-information-excel-config-parameters.PNG)

We have incorporated this dataflow into our workflow by using the [*Run Dataflow* ](https://documentation.astera.com/workflows/run-dataflow)object. You will notice that the *FilePath* variable is visible in the object layout.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/8FIrZU4zHXYPA3ctZTqT/04-context-information-run-dataflow.PNG)

Go to the Resources section in the Toolbox, and drag-and-drop the *Context Information* object onto the workflow designer.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/hxR1EXH0mDzJFfdUehRw/05-context-information-workflow.PNG)

In the object layout, you can see all of the context information parameters that are available. If you wish to see their data types, right-click on the object header and select *Properties* from the context menu.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/tPcduxBadrpCeko9EWzo/06-context-information-properties.PNG)

* *Name*: Name of the workflow. For example, Workflow1.wf
* *JobId*: ID of the job assigned by the server
* *ScheduledJobId*: ID of the job associated with a schedule in case of scheduled running on a server
* *ServerName*: Name of the server running the workflow
* *UserName*: User account that runs the workflow
* *DroppedFilePath*: Path to the file being dropped, in case of a scheduled job of type ‘When File is Dropped’

As mentioned earlier, all of these parameters take their values at run-time.

In this case, we require the *DroppedFilePath* parameter’s value to be fed to the source object in our dataflow. Map this parameter from the *Context Information* object to the *FilePath* variable that is visible under the *Input* node of the *Run Dataflow* object.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/tGlfFu0rrHok1KIArzdt/07-context-information-worflow.PNG)

Now, all that is left is to schedule this job to run whenever a source file is dropped into a specified folder. For this, we have selected the *When File is Dropped* option under the *Frequency* section of the [*Job Scheduler*](https://documentation.astera.com/project-management-and-scheduling/job-scheduling/scheduling-jobs-on-the-server)*.*

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/dYtCdPlqpMhXU6yOT1N8/13-context-information-job-scheduler.PNG)

Further, we have specified a directory where the files will be dropped.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/1turef9RyL9J09wFx0Lw/14-context-info-job-scheduler-file-drop.png)

Once we have created this schedule, every delimited file dropped into this folder will automatically be written to the destination table. Here is a look at the destination table after we have added one source file to the folder.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/9JyWBFC5C0122ttnf0yY/15-context-information-destination-table.PNG)

This concludes using the *Context Information* object in Astera.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.astera.com/miscellaneous/context-information.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
