diff --git a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/MainActivity.java b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/MainActivity.java
index 109e1d0..392bae3 100644
--- a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/MainActivity.java
+++ b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/MainActivity.java
@@ -25,8 +25,6 @@
 import android.view.View;
 import android.widget.EditText;
 
-import java.util.concurrent.TimeUnit;
-
 import androidx.work.Constraints;
 import androidx.work.NetworkType;
 import androidx.work.Work;
@@ -35,6 +33,8 @@
 import androidx.work.integration.testapp.imageprocessing.ImageProcessingActivity;
 import androidx.work.integration.testapp.sherlockholmes.AnalyzeSherlockHolmesActivity;
 
+import java.util.concurrent.TimeUnit;
+
 /**
  * Main Activity
  */
diff --git a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/ToastWorker.java b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/ToastWorker.java
index 9bd9fde..8aff2bf 100644
--- a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/ToastWorker.java
+++ b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/ToastWorker.java
@@ -20,7 +20,7 @@
 import android.util.Log;
 import android.widget.Toast;
 
-import androidx.work.Arguments;
+import androidx.work.Data;
 import androidx.work.Work;
 import androidx.work.Worker;
 
@@ -37,14 +37,14 @@
      * @return A {@link Work.Builder}
      */
     public static Work.Builder create(String message) {
-        Arguments args = new Arguments.Builder().putString(ARG_MESSAGE, message).build();
-        return new Work.Builder(ToastWorker.class).withArguments(args);
+        Data input = new Data.Builder().putString(ARG_MESSAGE, message).build();
+        return new Work.Builder(ToastWorker.class).withInputData(input);
     }
 
     @Override
     public WorkerResult doWork() {
-        Arguments args = getArguments();
-        final String message = args.getString(ARG_MESSAGE, "completed!");
+        Data input = getInputData();
+        final String message = input.getString(ARG_MESSAGE, "completed!");
         new Handler(Looper.getMainLooper()).post(new Runnable() {
             @Override
             public void run() {
diff --git a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageCleanupWorker.java b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageCleanupWorker.java
index 44fdab8..a3f182d 100644
--- a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageCleanupWorker.java
+++ b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageCleanupWorker.java
@@ -19,13 +19,13 @@
 import android.text.TextUtils;
 import android.util.Log;
 
-import java.io.File;
-import java.util.List;
-
 import androidx.work.Worker;
 import androidx.work.integration.testapp.db.Image;
 import androidx.work.integration.testapp.db.TestDatabase;
 
+import java.io.File;
+import java.util.List;
+
 /**
  * Removes all existing {@link Image} entities and deletes associated compressed files
  */
diff --git a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageProcessingActivity.java b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageProcessingActivity.java
index 873e760..f97f40c 100644
--- a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageProcessingActivity.java
+++ b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageProcessingActivity.java
@@ -27,14 +27,14 @@
 import android.util.Log;
 import android.view.View;
 
-import java.util.List;
-
 import androidx.work.Work;
 import androidx.work.WorkManager;
 import androidx.work.integration.testapp.R;
 import androidx.work.integration.testapp.db.Image;
 import androidx.work.integration.testapp.db.TestDatabase;
 
+import java.util.List;
+
 /**
  * Image Processing Activity
  */
diff --git a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageProcessingWorker.java b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageProcessingWorker.java
index ac4550d..63344f2 100644
--- a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageProcessingWorker.java
+++ b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageProcessingWorker.java
@@ -22,18 +22,18 @@
 import android.text.TextUtils;
 import android.util.Log;
 
+import androidx.work.Data;
+import androidx.work.Work;
+import androidx.work.Worker;
+import androidx.work.integration.testapp.db.Image;
+import androidx.work.integration.testapp.db.TestDatabase;
+
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
-import androidx.work.Arguments;
-import androidx.work.Work;
-import androidx.work.Worker;
-import androidx.work.integration.testapp.db.Image;
-import androidx.work.integration.testapp.db.TestDatabase;
-
 /**
  * Creates a compressed transformed image from a given {@link Uri} and writes
  * the information as a {@link Image} entity
@@ -46,7 +46,7 @@
     public WorkerResult doWork() {
         Log.d(TAG, "Started");
 
-        String uriString = getArguments().getString(URI_KEY, null);
+        String uriString = getInputData().getString(URI_KEY, null);
         if (TextUtils.isEmpty(uriString)) {
             Log.e(TAG, "Invalid URI!");
             return WorkerResult.FAILURE;
@@ -142,7 +142,7 @@
     }
 
     static Work createWork(String uriString) {
-        Arguments arguments = new Arguments.Builder().putString(URI_KEY, uriString).build();
-        return new Work.Builder(ImageProcessingWorker.class).withArguments(arguments).build();
+        Data input = new Data.Builder().putString(URI_KEY, uriString).build();
+        return new Work.Builder(ImageProcessingWorker.class).withInputData(input).build();
     }
 }
diff --git a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageRecyclerViewAdapter.java b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageRecyclerViewAdapter.java
index 652c596..2eeace2 100644
--- a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageRecyclerViewAdapter.java
+++ b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageRecyclerViewAdapter.java
@@ -29,12 +29,12 @@
 import android.widget.ProgressBar;
 import android.widget.TextView;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import androidx.work.integration.testapp.R;
 import androidx.work.integration.testapp.db.Image;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * Manages a gallery of {@link Image} entities
  */
diff --git a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageSetupWorker.java b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageSetupWorker.java
index 5f8f151..4fd8313 100644
--- a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageSetupWorker.java
+++ b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/imageprocessing/ImageSetupWorker.java
@@ -19,7 +19,7 @@
 import android.text.TextUtils;
 import android.util.Log;
 
-import androidx.work.Arguments;
+import androidx.work.Data;
 import androidx.work.Work;
 import androidx.work.Worker;
 import androidx.work.integration.testapp.db.Image;
@@ -36,7 +36,7 @@
     public WorkerResult doWork() {
         Log.d(TAG, "Started");
 
-        String uriString = getArguments().getString(URI_KEY, null);
+        String uriString = getInputData().getString(URI_KEY, null);
         if (TextUtils.isEmpty(uriString)) {
             Log.e(TAG, "Invalid URI!");
             return WorkerResult.FAILURE;
@@ -50,7 +50,7 @@
     }
 
     static Work createWork(String uriString) {
-        Arguments arguments = new Arguments.Builder().putString(URI_KEY, uriString).build();
-        return new Work.Builder(ImageSetupWorker.class).withArguments(arguments).build();
+        Data input = new Data.Builder().putString(URI_KEY, uriString).build();
+        return new Work.Builder(ImageSetupWorker.class).withInputData(input).build();
     }
 }
diff --git a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/sherlockholmes/AnalyzeSherlockHolmesActivity.java b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/sherlockholmes/AnalyzeSherlockHolmesActivity.java
index 85ef5c2..88fe358 100644
--- a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/sherlockholmes/AnalyzeSherlockHolmesActivity.java
+++ b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/sherlockholmes/AnalyzeSherlockHolmesActivity.java
@@ -26,8 +26,6 @@
 import android.widget.ProgressBar;
 import android.widget.TextView;
 
-import java.util.List;
-
 import androidx.work.ArrayCreatingInputMerger;
 import androidx.work.Work;
 import androidx.work.WorkManager;
@@ -35,6 +33,8 @@
 import androidx.work.integration.testapp.db.TestDatabase;
 import androidx.work.integration.testapp.db.WordCount;
 
+import java.util.List;
+
 /**
  * Analyze Sherlock Holmes activity.
  */
diff --git a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/sherlockholmes/TextMappingWorker.java b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/sherlockholmes/TextMappingWorker.java
index 4d88ff0..f456c37 100644
--- a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/sherlockholmes/TextMappingWorker.java
+++ b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/sherlockholmes/TextMappingWorker.java
@@ -19,6 +19,10 @@
 import android.content.res.AssetManager;
 import android.util.Log;
 
+import androidx.work.Data;
+import androidx.work.Work;
+import androidx.work.Worker;
+
 import java.io.DataOutputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -27,10 +31,6 @@
 import java.util.Map;
 import java.util.Scanner;
 
-import androidx.work.Arguments;
-import androidx.work.Work;
-import androidx.work.Worker;
-
 /**
  * A Worker that counts words of length > 3 and stores the results.
  */
@@ -47,16 +47,16 @@
      * @return A {@link Work.Builder} with these arguments
      */
     public static Work.Builder create(String inputFile) {
-        Arguments args = new Arguments.Builder()
+        Data input = new Data.Builder()
                 .putString(INPUT_FILE, inputFile)
                 .build();
-        return new Work.Builder(TextMappingWorker.class).withArguments(args);
+        return new Work.Builder(TextMappingWorker.class).withInputData(input);
     }
 
     @Override
     public WorkerResult doWork() {
-        Arguments args = getArguments();
-        String inputFileName = args.getString(INPUT_FILE, null);
+        Data input = getInputData();
+        String inputFileName = input.getString(INPUT_FILE, null);
         String outputFileName = "out_" + inputFileName;
 
         AssetManager assetManager = getAppContext().getAssets();
@@ -118,7 +118,7 @@
             }
         }
 
-        setOutput(new Arguments.Builder().putString(INPUT_FILE, outputFileName).build());
+        setOutputData(new Data.Builder().putString(INPUT_FILE, outputFileName).build());
 
         Log.d("Map", "Mapping finished for " + inputFileName);
         return WorkerResult.SUCCESS;
diff --git a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/sherlockholmes/TextReducingWorker.java b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/sherlockholmes/TextReducingWorker.java
index 7defd6f..ddd419e 100644
--- a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/sherlockholmes/TextReducingWorker.java
+++ b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/sherlockholmes/TextReducingWorker.java
@@ -17,6 +17,11 @@
 
 import android.util.Log;
 
+import androidx.work.Data;
+import androidx.work.Worker;
+import androidx.work.integration.testapp.db.TestDatabase;
+import androidx.work.integration.testapp.db.WordCount;
+
 import java.io.DataInputStream;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -26,11 +31,6 @@
 import java.util.List;
 import java.util.Map;
 
-import androidx.work.Arguments;
-import androidx.work.Worker;
-import androidx.work.integration.testapp.db.TestDatabase;
-import androidx.work.integration.testapp.db.WordCount;
-
 /**
  * A Worker that combines the word counts of various works and outputs them.
  */
@@ -42,8 +42,8 @@
 
     @Override
     public WorkerResult doWork() {
-        Arguments args = getArguments();
-        String[] inputFiles = args.getStringArray(INPUT_FILE);
+        Data input = getInputData();
+        String[] inputFiles = input.getStringArray(INPUT_FILE);
         if (inputFiles == null) {
             throw new IllegalArgumentException();
         }
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkContinuationImplTest.java b/work/workmanager/src/androidTest/java/androidx/work/impl/WorkContinuationImplTest.java
index 623ea5d..6dfb507 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkContinuationImplTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/impl/WorkContinuationImplTest.java
@@ -35,7 +35,7 @@
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
-import androidx.work.Arguments;
+import androidx.work.Data;
 import androidx.work.State;
 import androidx.work.TestLifecycleOwner;
 import androidx.work.Work;
@@ -262,10 +262,10 @@
 
         workSpecDao.setOutput(
                 firstWork.getId(),
-                new Arguments.Builder().putInt(intTag, 0).build());
+                new Data.Builder().putInt(intTag, 0).build());
         workSpecDao.setOutput(
                 secondWork.getId(),
-                new Arguments.Builder().putInt(intTag, 1).putString(stringTag, "hello").build());
+                new Data.Builder().putInt(intTag, 1).putString(stringTag, "hello").build());
 
         WorkContinuationImpl firstContinuation =
                 new WorkContinuationImpl(mWorkManagerImpl, Collections.singletonList(firstWork));
@@ -296,7 +296,7 @@
         assertThat(joinWorkSpec, is(not(nullValue())));
         assertThat(joinWorkSpec.state, is(State.SUCCEEDED));
 
-        Arguments output = joinWorkSpec.output;
+        Data output = joinWorkSpec.output;
         int[] intArray = output.getIntArray(intTag);
 
         assertThat(intArray, is(not(nullValue())));
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java b/work/workmanager/src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java
index b8823d0..4f8b849 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java
@@ -59,11 +59,11 @@
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
-import androidx.work.Arguments;
 import androidx.work.BackoffPolicy;
 import androidx.work.BaseWork;
 import androidx.work.Constraints;
 import androidx.work.ContentUriTriggers;
+import androidx.work.Data;
 import androidx.work.PeriodicWork;
 import androidx.work.TestLifecycleOwner;
 import androidx.work.Work;
@@ -652,12 +652,12 @@
         WorkStatus workStatus0 = new WorkStatus(
                 work0.getId(),
                 ENQUEUED,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Collections.<String>emptyList());
         WorkStatus workStatus1 = new WorkStatus(
                 work1.getId(),
                 ENQUEUED,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Collections.<String>emptyList());
         assertThat(captor.getValue(), containsInAnyOrder(workStatus0, workStatus1));
 
@@ -671,7 +671,7 @@
         workStatus0 = new WorkStatus(
                 work0.getId(),
                 RUNNING,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Collections.<String>emptyList());
         assertThat(captor.getValue(), containsInAnyOrder(workStatus0, workStatus1));
 
@@ -685,7 +685,7 @@
         workStatus1 = new WorkStatus(
                 work1.getId(),
                 RUNNING,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Collections.<String>emptyList());
         assertThat(captor.getValue(), containsInAnyOrder(workStatus0, workStatus1));
 
@@ -718,17 +718,17 @@
         WorkStatus workStatus0 = new WorkStatus(
                 work0.getId(),
                 RUNNING,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Arrays.asList(firstTag, secondTag));
         WorkStatus workStatus1 = new WorkStatus(
                 work1.getId(),
                 BLOCKED,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Collections.singletonList(firstTag));
         WorkStatus workStatus2 = new WorkStatus(
                 work2.getId(),
                 SUCCEEDED,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Collections.singletonList(secondTag));
 
         List<WorkStatus> workStatuses = mWorkManagerImpl.getStatusesByTagBlocking(firstTag);
@@ -780,12 +780,12 @@
         WorkStatus workStatus0 = new WorkStatus(
                 work0.getId(),
                 RUNNING,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Arrays.asList(firstTag, secondTag));
         WorkStatus workStatus1 = new WorkStatus(
                 work1.getId(),
                 BLOCKED,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Collections.singletonList(firstTag));
         assertThat(captor.getValue(), containsInAnyOrder(workStatus0, workStatus1));
 
@@ -798,7 +798,7 @@
         workStatus0 = new WorkStatus(
                 work0.getId(),
                 ENQUEUED,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Arrays.asList(firstTag, secondTag));
         assertThat(captor.getValue(), containsInAnyOrder(workStatus0, workStatus1));
 
@@ -820,17 +820,17 @@
         WorkStatus workStatus0 = new WorkStatus(
                 work0.getId(),
                 RUNNING,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Collections.<String>emptyList());
         WorkStatus workStatus1 = new WorkStatus(
                 work1.getId(),
                 BLOCKED,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Collections.<String>emptyList());
         WorkStatus workStatus2 = new WorkStatus(
                 work2.getId(),
                 BLOCKED,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Collections.<String>emptyList());
 
         List<WorkStatus> workStatuses = mWorkManagerImpl.getStatusesByNameBlocking(testName);
@@ -868,17 +868,17 @@
         WorkStatus workStatus0 = new WorkStatus(
                 work0.getId(),
                 RUNNING,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Collections.<String>emptyList());
         WorkStatus workStatus1 = new WorkStatus(
                 work1.getId(),
                 BLOCKED,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Collections.<String>emptyList());
         WorkStatus workStatus2 = new WorkStatus(
                 work2.getId(),
                 BLOCKED,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Collections.<String>emptyList());
         assertThat(captor.getValue(), containsInAnyOrder(workStatus0, workStatus1, workStatus2));
 
@@ -891,7 +891,7 @@
         workStatus0 = new WorkStatus(
                 work0.getId(),
                 ENQUEUED,
-                Arguments.EMPTY,
+                Data.EMPTY,
                 Collections.<String>emptyList());
         assertThat(captor.getValue(), containsInAnyOrder(workStatus0, workStatus1, workStatus2));
 
@@ -1177,7 +1177,7 @@
 
         WorkSpec workSpec = mDatabase.workSpecDao().getWorkSpec(work.getId());
         assertThat(workSpec.workerClassName, is(ConstraintTrackingWorker.class.getName()));
-        assertThat(workSpec.arguments.getString(
+        assertThat(workSpec.input.getString(
                 ConstraintTrackingWorker.ARGUMENT_CLASS_NAME, null),
                 is(TestWorker.class.getName()));
     }
@@ -1195,7 +1195,7 @@
 
         WorkSpec workSpec = mDatabase.workSpecDao().getWorkSpec(work.getId());
         assertThat(workSpec.workerClassName, is(ConstraintTrackingWorker.class.getName()));
-        assertThat(workSpec.arguments.getString(
+        assertThat(workSpec.input.getString(
                 ConstraintTrackingWorker.ARGUMENT_CLASS_NAME, null),
                 is(TestWorker.class.getName()));
     }
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkerWrapperTest.java b/work/workmanager/src/androidTest/java/androidx/work/impl/WorkerWrapperTest.java
index 2e11438..3be8d1d 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkerWrapperTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/impl/WorkerWrapperTest.java
@@ -41,8 +41,8 @@
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
-import androidx.work.Arguments;
 import androidx.work.ArrayCreatingInputMerger;
+import androidx.work.Data;
 import androidx.work.DatabaseTest;
 import androidx.work.PeriodicWork;
 import androidx.work.Work;
@@ -283,7 +283,7 @@
                 .withSchedulers(Collections.singletonList(mMockScheduler))
                 .build().run();
 
-        List<Arguments> arguments = mWorkSpecDao.getInputsFromPrerequisites(work.getId());
+        List<Data> arguments = mWorkSpecDao.getInputsFromPrerequisites(work.getId());
         assertThat(arguments.size(), is(1));
         assertThat(arguments, contains(ChainedArgumentWorker.getChainedArguments()));
     }
@@ -296,10 +296,10 @@
         String value2 = "value2";
 
         Work prerequisiteWork1 = new Work.Builder(EchoingWorker.class)
-                .withArguments(new Arguments.Builder().putString(key, value1).build())
+                .withInputData(new Data.Builder().putString(key, value1).build())
                 .build();
         Work prerequisiteWork2 = new Work.Builder(EchoingWorker.class)
-                .withArguments(new Arguments.Builder().putString(key, value2).build())
+                .withInputData(new Data.Builder().putString(key, value2).build())
                 .build();
         Work work = new Work.Builder(TestWorker.class)
                 .withInputMerger(ArrayCreatingInputMerger.class)
@@ -334,9 +334,9 @@
                 .build();
         workerWrapper.run();
 
-        Arguments arguments = workerWrapper.mWorker.getArguments();
-        assertThat(arguments.size(), is(1));
-        assertThat(Arrays.asList(arguments.getStringArray(key)),
+        Data input = workerWrapper.mWorker.getInputData();
+        assertThat(input.size(), is(1));
+        assertThat(Arrays.asList(input.getStringArray(key)),
                 containsInAnyOrder(value1, value2));
     }
 
@@ -531,7 +531,7 @@
         Worker worker = WorkerWrapper.workerFromWorkSpec(
                 mContext,
                 getWorkSpec(work),
-                Arguments.EMPTY,
+                Data.EMPTY,
                 null);
 
         assertThat(worker, is(notNullValue()));
@@ -543,27 +543,27 @@
     public void testFromWorkSpec_hasCorrectArguments() throws InterruptedException {
         String key = "KEY";
         String expectedValue = "VALUE";
-        Arguments arguments = new Arguments.Builder().putString(key, expectedValue).build();
+        Data input = new Data.Builder().putString(key, expectedValue).build();
 
-        Work work = new Work.Builder(TestWorker.class).withArguments(arguments).build();
+        Work work = new Work.Builder(TestWorker.class).withInputData(input).build();
         Worker worker = WorkerWrapper.workerFromWorkSpec(
                 mContext,
                 getWorkSpec(work),
-                arguments,
+                input,
                 null);
 
         assertThat(worker, is(notNullValue()));
-        assertThat(worker.getArguments().getString(key, null), is(expectedValue));
+        assertThat(worker.getInputData().getString(key, null), is(expectedValue));
 
         work = new Work.Builder(TestWorker.class).build();
         worker = WorkerWrapper.workerFromWorkSpec(
                 mContext,
                 getWorkSpec(work),
-                Arguments.EMPTY,
+                Data.EMPTY,
                 null);
 
         assertThat(worker, is(notNullValue()));
-        assertThat(worker.getArguments().size(), is(0));
+        assertThat(worker.getInputData().size(), is(0));
     }
 
     @Test
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/workers/ConstraintTrackingWorkerTest.java b/work/workmanager/src/androidTest/java/androidx/work/impl/workers/ConstraintTrackingWorkerTest.java
index 24d35c8..2fde43b 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/impl/workers/ConstraintTrackingWorkerTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/impl/workers/ConstraintTrackingWorkerTest.java
@@ -31,8 +31,8 @@
 import android.support.test.filters.SmallTest;
 import android.support.test.runner.AndroidJUnit4;
 
-import androidx.work.Arguments;
 import androidx.work.Constraints;
+import androidx.work.Data;
 import androidx.work.DatabaseTest;
 import androidx.work.State;
 import androidx.work.Work;
@@ -124,13 +124,13 @@
 
         String delegateName = EchoingWorker.class.getName();
 
-        Arguments arguments = new Arguments.Builder()
+        Data input = new Data.Builder()
                 .putString(ConstraintTrackingWorker.ARGUMENT_CLASS_NAME, delegateName)
                 .putBoolean(TEST_ARGUMENT_NAME, true)
                 .build();
 
         final Work work = new Work.Builder(ConstraintTrackingWorker.class)
-                .withArguments(arguments)
+                .withInputData(input)
                 .withConstraints(constraints)
                 .build();
 
@@ -142,7 +142,7 @@
                         mContext,
                         ConstraintTrackingWorker.class.getName(),
                         workSpecId,
-                        arguments,
+                        input,
                         null);
 
         ConstraintTrackingWorker spyWorker = spy(worker);
@@ -158,7 +158,7 @@
         WorkSpec workSpec = mDatabase.workSpecDao().getWorkSpec(workSpecId);
         assertThat(mLatch.getCount(), is(0L));
         assertThat(workSpec.state, is(State.SUCCEEDED));
-        Arguments output = workSpec.output;
+        Data output = workSpec.output;
         assertThat(output.getBoolean(TEST_ARGUMENT_NAME, false), is(true));
     }
 
@@ -171,7 +171,7 @@
                 .build();
 
         String delegateName = TestWorker.class.getName();
-        Arguments arguments = new Arguments.Builder()
+        Data input = new Data.Builder()
                 .putString(ConstraintTrackingWorker.ARGUMENT_CLASS_NAME, delegateName)
                 .build();
 
@@ -187,7 +187,7 @@
                         mContext,
                         ConstraintTrackingWorker.class.getName(),
                         workSpecId,
-                        arguments,
+                        input,
                         null);
 
         ConstraintTrackingWorker spyWorker = spy(worker);
@@ -214,7 +214,7 @@
                 .build();
 
         String delegateName = SleepTestWorker.class.getName();
-        Arguments arguments = new Arguments.Builder()
+        Data input = new Data.Builder()
                 .putString(ConstraintTrackingWorker.ARGUMENT_CLASS_NAME, delegateName)
                 .build();
 
@@ -231,7 +231,7 @@
                         mContext,
                         ConstraintTrackingWorker.class.getName(),
                         workSpecId,
-                        arguments,
+                        input,
                         null);
 
         ConstraintTrackingWorker spyWorker = spy(worker);
@@ -266,7 +266,7 @@
                 .build();
 
         String delegateName = SleepTestWorker.class.getName();
-        Arguments arguments = new Arguments.Builder()
+        Data input = new Data.Builder()
                 .putString(ConstraintTrackingWorker.ARGUMENT_CLASS_NAME, delegateName)
                 .build();
 
@@ -283,7 +283,7 @@
                         mContext,
                         ConstraintTrackingWorker.class.getName(),
                         workSpecId,
-                        arguments,
+                        input,
                         null);
 
         ConstraintTrackingWorker spyWorker = spy(worker);
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/ChainedArgumentWorker.java b/work/workmanager/src/androidTest/java/androidx/work/worker/ChainedArgumentWorker.java
index 0facacc..ffdcfe7 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/worker/ChainedArgumentWorker.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/worker/ChainedArgumentWorker.java
@@ -16,7 +16,7 @@
 
 package androidx.work.worker;
 
-import androidx.work.Arguments;
+import androidx.work.Data;
 import androidx.work.Worker;
 
 /**
@@ -30,11 +30,11 @@
 
     @Override
     public WorkerResult doWork() {
-        setOutput(getChainedArguments());
+        setOutputData(getChainedArguments());
         return WorkerResult.SUCCESS;
     }
 
-    public static Arguments getChainedArguments() {
-        return new Arguments.Builder().putString(ARGUMENT_KEY, ARGUMENT_VALUE).build();
+    public static Data getChainedArguments() {
+        return new Data.Builder().putString(ARGUMENT_KEY, ARGUMENT_VALUE).build();
     }
 }
diff --git a/work/workmanager/src/androidTest/java/androidx/work/worker/EchoingWorker.java b/work/workmanager/src/androidTest/java/androidx/work/worker/EchoingWorker.java
index 4f2be55..48bcae3 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/worker/EchoingWorker.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/worker/EchoingWorker.java
@@ -22,7 +22,7 @@
 
     @Override
     public WorkerResult doWork() {
-        setOutput(getArguments());
+        setOutputData(getInputData());
         return WorkerResult.SUCCESS;
     }
 }
diff --git a/work/workmanager/src/main/java/androidx/work/ArrayCreatingInputMerger.java b/work/workmanager/src/main/java/androidx/work/ArrayCreatingInputMerger.java
index a3bf429..cc00343 100644
--- a/work/workmanager/src/main/java/androidx/work/ArrayCreatingInputMerger.java
+++ b/work/workmanager/src/main/java/androidx/work/ArrayCreatingInputMerger.java
@@ -40,11 +40,11 @@
 public class ArrayCreatingInputMerger extends InputMerger {
 
     @Override
-    public Arguments merge(List<Arguments> inputs) {
-        Arguments.Builder output = new Arguments.Builder();
+    public Data merge(List<Data> inputs) {
+        Data.Builder output = new Data.Builder();
         Map<String, Object> mergedValues = new HashMap<>();
 
-        for (Arguments input : inputs) {
+        for (Data input : inputs) {
             for (Map.Entry<String, Object> entry : input.getKeyValueMap().entrySet()) {
                 String key = entry.getKey();
                 Object value = entry.getValue();
diff --git a/work/workmanager/src/main/java/androidx/work/BaseWork.java b/work/workmanager/src/main/java/androidx/work/BaseWork.java
index fcbaf82..9bfb367 100644
--- a/work/workmanager/src/main/java/androidx/work/BaseWork.java
+++ b/work/workmanager/src/main/java/androidx/work/BaseWork.java
@@ -137,13 +137,13 @@
         }
 
         /**
-         * Add arguments to the work.
+         * Add input {@link Data} to the work.
          *
-         * @param arguments key/value pairs that will be provided to the {@link Worker} class
+         * @param inputData key/value pairs that will be provided to the {@link Worker} class
          * @return The current {@link Builder}
          */
-        public B withArguments(@NonNull Arguments arguments) {
-            mWorkSpec.arguments = arguments;
+        public B withInputData(@NonNull Data inputData) {
+            mWorkSpec.input = inputData;
             return getThis();
         }
 
diff --git a/work/workmanager/src/main/java/androidx/work/Arguments.java b/work/workmanager/src/main/java/androidx/work/Data.java
similarity index 92%
rename from work/workmanager/src/main/java/androidx/work/Arguments.java
rename to work/workmanager/src/main/java/androidx/work/Data.java
index a28f1fe..8d47884 100644
--- a/work/workmanager/src/main/java/androidx/work/Arguments.java
+++ b/work/workmanager/src/main/java/androidx/work/Data.java
@@ -35,18 +35,18 @@
  * Persistable set of key/value pairs which are passed to {@link Worker}s.
  */
 
-public final class Arguments {
+public final class Data {
 
-    private static final String TAG = "Arguments";
+    private static final String TAG = "Data";
 
     private Map<String, Object> mValues;
 
-    public static final Arguments EMPTY = new Arguments.Builder().build();
+    public static final Data EMPTY = new Data.Builder().build();
 
-    Arguments() {    // stub required for room
+    Data() {    // stub required for room
     }
 
-    Arguments(Map<String, ?> values) {
+    Data(Map<String, ?> values) {
         mValues = new HashMap<>(values);
     }
 
@@ -263,7 +263,7 @@
     }
 
     /**
-     * Gets all the values in this Arguments object.
+     * Gets all the values in this Data object.
      *
      * @return A {@link Map} of key-value pairs for this object; this Map is unmodifiable and should
      * be used for reads only.
@@ -281,19 +281,19 @@
     }
 
     /**
-     * Converts {@link Arguments} to a byte array for persistent storage.
+     * Converts {@link Data} to a byte array for persistent storage.
      *
-     * @param arguments The {@link Arguments} object to convert
+     * @param data The {@link Data} object to convert
      * @return The byte array representation of the input
      */
     @TypeConverter
-    public static byte[] toByteArray(Arguments arguments) {
+    public static byte[] toByteArray(Data data) {
         ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
         ObjectOutputStream objectOutputStream = null;
         try {
             objectOutputStream = new ObjectOutputStream(outputStream);
-            objectOutputStream.writeInt(arguments.size());
-            for (Map.Entry<String, Object> entry : arguments.mValues.entrySet()) {
+            objectOutputStream.writeInt(data.size());
+            for (Map.Entry<String, Object> entry : data.mValues.entrySet()) {
                 objectOutputStream.writeUTF(entry.getKey());
                 objectOutputStream.writeObject(entry.getValue());
             }
@@ -317,13 +317,13 @@
     }
 
     /**
-     * Converts a byte array to {@link Arguments}.
+     * Converts a byte array to {@link Data}.
      *
      * @param bytes The byte array representation to convert
-     * @return An {@link Arguments} object built from the input
+     * @return An {@link Data} object built from the input
      */
     @TypeConverter
-    public static Arguments fromByteArray(byte[] bytes) {
+    public static Data fromByteArray(byte[] bytes) {
         Map<String, Object> map = new HashMap<>();
         ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
         ObjectInputStream objectInputStream = null;
@@ -348,7 +348,7 @@
                 e.printStackTrace();
             }
         }
-        return new Arguments(map);
+        return new Data(map);
     }
 
     @Override
@@ -359,7 +359,7 @@
         if (o == null || getClass() != o.getClass()) {
             return false;
         }
-        Arguments other = (Arguments) o;
+        Data other = (Data) o;
         return mValues.equals(other.mValues);
     }
 
@@ -409,7 +409,7 @@
     }
 
     /**
-     * A builder for {@link Arguments}.
+     * A builder for {@link Data}.
      */
     public static class Builder {
 
@@ -560,16 +560,16 @@
         }
 
         /**
-         * Puts all input key-value pairs from the {@link Arguments} into the Builder.
+         * Puts all input key-value pairs from the {@link Data} into the Builder.
          * Any non-valid types will be logged and ignored.  Valid types are: Boolean, Integer,
          * Long, Double, String, and array versions of each of those types.
          * Any {@code null} values will also be ignored.
          *
-         * @param values {@link Arguments} containing key-value pairs to add
+         * @param data {@link Data} containing key-value pairs to add
          * @return The {@link Builder}
          */
-        public Builder putAll(@NonNull Arguments values) {
-            putAll(values.mValues);
+        public Builder putAll(@NonNull Data data) {
+            putAll(data.mValues);
             return this;
         }
 
@@ -618,13 +618,13 @@
         }
 
         /**
-         * Builds an {@link Arguments} object.
+         * Builds an {@link Data} object.
          *
-         * @return The {@link Arguments} object containing all key-value pairs specified by this
+         * @return The {@link Data} object containing all key-value pairs specified by this
          *         {@link Builder}.
          */
-        public Arguments build() {
-            return new Arguments(mValues);
+        public Data build() {
+            return new Data(mValues);
         }
     }
 }
diff --git a/work/workmanager/src/main/java/androidx/work/InputMerger.java b/work/workmanager/src/main/java/androidx/work/InputMerger.java
index a43aab3..bb1becc 100644
--- a/work/workmanager/src/main/java/androidx/work/InputMerger.java
+++ b/work/workmanager/src/main/java/androidx/work/InputMerger.java
@@ -30,12 +30,12 @@
     private static final String TAG = "InputMerger";
 
     /**
-     * Merges a list of {@link Arguments} and outputs a single Arguments object.
+     * Merges a list of {@link Data} and outputs a single Data object.
      *
-     * @param inputs A list of {@link Arguments} from previous Workers or the Work.Builder
+     * @param inputs A list of {@link Data} from previous Workers or the Work.Builder
      * @return The merged output
      */
-    public abstract Arguments merge(List<Arguments> inputs);
+    public abstract Data merge(List<Data> inputs);
 
     /**
      * Instantiates an {@link InputMerger} from its class name.
diff --git a/work/workmanager/src/main/java/androidx/work/OverwritingInputMerger.java b/work/workmanager/src/main/java/androidx/work/OverwritingInputMerger.java
index 6a080ec..86c50d4 100644
--- a/work/workmanager/src/main/java/androidx/work/OverwritingInputMerger.java
+++ b/work/workmanager/src/main/java/androidx/work/OverwritingInputMerger.java
@@ -30,11 +30,11 @@
 public class OverwritingInputMerger extends InputMerger {
 
     @Override
-    public Arguments merge(List<Arguments> inputs) {
-        Arguments.Builder output = new Arguments.Builder();
+    public Data merge(List<Data> inputs) {
+        Data.Builder output = new Data.Builder();
         Map<String, Object> mergedValues = new HashMap<>();
 
-        for (Arguments input : inputs) {
+        for (Data input : inputs) {
             mergedValues.putAll(input.getKeyValueMap());
         }
 
diff --git a/work/workmanager/src/main/java/androidx/work/WorkStatus.java b/work/workmanager/src/main/java/androidx/work/WorkStatus.java
index 9f19ed0..039e4db 100644
--- a/work/workmanager/src/main/java/androidx/work/WorkStatus.java
+++ b/work/workmanager/src/main/java/androidx/work/WorkStatus.java
@@ -32,17 +32,17 @@
 
     private String mId;
     private State mState;
-    private Arguments mOutput;
+    private Data mOutputData;
     private Set<String> mTags;
 
     public WorkStatus(
             @NonNull String id,
             @NonNull State state,
-            @NonNull Arguments output,
+            @NonNull Data outputData,
             @NonNull List<String> tags) {
         mId = id;
         mState = state;
-        mOutput = output;
+        mOutputData = outputData;
         mTags = new HashSet<>(tags);
     }
 
@@ -54,8 +54,8 @@
         return mState;
     }
 
-    public @NonNull Arguments getOutputArguments() {
-        return mOutput;
+    public @NonNull Data getOutputData() {
+        return mOutputData;
     }
 
     public @NonNull Set<String> getTags() {
@@ -71,7 +71,10 @@
 
         if (mId != null ? !mId.equals(that.mId) : that.mId != null) return false;
         if (mState != that.mState) return false;
-        if (mOutput != null ? !mOutput.equals(that.mOutput) : that.mOutput != null) return false;
+        if (mOutputData != null ? !mOutputData.equals(that.mOutputData)
+                : that.mOutputData != null) {
+            return false;
+        }
         return mTags != null ? mTags.equals(that.mTags) : that.mTags == null;
     }
 
@@ -79,7 +82,7 @@
     public int hashCode() {
         int result = mId != null ? mId.hashCode() : 0;
         result = 31 * result + (mState != null ? mState.hashCode() : 0);
-        result = 31 * result + (mOutput != null ? mOutput.hashCode() : 0);
+        result = 31 * result + (mOutputData != null ? mOutputData.hashCode() : 0);
         result = 31 * result + (mTags != null ? mTags.hashCode() : 0);
         return result;
     }
diff --git a/work/workmanager/src/main/java/androidx/work/Worker.java b/work/workmanager/src/main/java/androidx/work/Worker.java
index e407b5d..4cb0e20 100644
--- a/work/workmanager/src/main/java/androidx/work/Worker.java
+++ b/work/workmanager/src/main/java/androidx/work/Worker.java
@@ -40,8 +40,8 @@
 
     private Context mAppContext;
     private @NonNull String mId;
-    private @NonNull Arguments mArguments;
-    private Arguments mOutput;
+    private @NonNull Data mInputData;
+    private Data mOutputData;
     private RuntimeExtras mRuntimeExtras;
 
     public final Context getAppContext() {
@@ -52,8 +52,8 @@
         return mId;
     }
 
-    public final @NonNull Arguments getArguments() {
-        return mArguments;
+    public final @NonNull Data getInputData() {
+        return mInputData;
     }
 
     @RequiresApi(24)
@@ -79,9 +79,9 @@
     public abstract WorkerResult doWork();
 
     /**
-     * Call this method to pass an {@link Arguments} object to {@link Work} that is dependent on
+     * Call this method to pass an {@link Data} object to {@link Work} that is dependent on
      * this one.  Note that if there are multiple {@link Worker}s that contribute to the target, the
-     * Arguments will be merged together, so it is up to the developer to make sure that keys are
+     * Data will be merged together, so it is up to the developer to make sure that keys are
      * unique.  New values and types will clobber old values and types, and if there are multiple
      * parent Workers of a child Worker, the order of clobbering may not be deterministic.
      *
@@ -96,29 +96,29 @@
      *            .enqueue()}
      *
      * This method would be called for both WorkerA and WorkerB after their successful completion,
-     * modifying the input Arguments for WorkerC.
+     * modifying the input Data for WorkerC.
      *
-     * @param output An {@link Arguments} object that will be merged into the input Arguments of any
+     * @param outputData An {@link Data} object that will be merged into the input Data of any
      *               Work that is dependent on this one, or {@code null} if there is nothing to
      *               contribute
      */
-    public final void setOutput(Arguments output) {
-        mOutput = output;
+    public final void setOutputData(Data outputData) {
+        mOutputData = outputData;
     }
 
-    public final Arguments getOutput() {
-        return mOutput;
+    public final Data getOutputData() {
+        return mOutputData;
     }
 
     @Keep
     private void internalInit(
             Context appContext,
             @NonNull String id,
-            @NonNull Arguments arguments,
+            @NonNull Data inputData,
             @Nullable RuntimeExtras runtimeExtras) {
         mAppContext = appContext;
         mId = id;
-        mArguments = arguments;
+        mInputData = inputData;
         mRuntimeExtras = runtimeExtras;
     }
 
diff --git a/work/workmanager/src/main/java/androidx/work/impl/WorkDatabase.java b/work/workmanager/src/main/java/androidx/work/impl/WorkDatabase.java
index bf0d182..71fb17c 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/WorkDatabase.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/WorkDatabase.java
@@ -29,8 +29,8 @@
 import android.support.annotation.NonNull;
 import android.support.annotation.RestrictTo;
 
-import androidx.work.Arguments;
 import androidx.work.ContentUriTriggers;
+import androidx.work.Data;
 import androidx.work.impl.model.AlarmInfo;
 import androidx.work.impl.model.AlarmInfoDao;
 import androidx.work.impl.model.Dependency;
@@ -61,7 +61,7 @@
         WorkName.class},
         version = 1,
         exportSchema = false)
-@TypeConverters(value = {Arguments.class, ContentUriTriggers.class, EnumTypeConverters.class})
+@TypeConverters(value = {Data.class, ContentUriTriggers.class, EnumTypeConverters.class})
 public abstract class WorkDatabase extends RoomDatabase {
 
     private static final String DB_NAME = "androidx.work.workdb";
diff --git a/work/workmanager/src/main/java/androidx/work/impl/WorkerWrapper.java b/work/workmanager/src/main/java/androidx/work/impl/WorkerWrapper.java
index 6c7bd9f..6dae6da 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/WorkerWrapper.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/WorkerWrapper.java
@@ -30,7 +30,7 @@
 import android.support.annotation.WorkerThread;
 import android.util.Log;
 
-import androidx.work.Arguments;
+import androidx.work.Data;
 import androidx.work.InputMerger;
 import androidx.work.State;
 import androidx.work.Worker;
@@ -94,9 +94,9 @@
             return;
         }
 
-        Arguments arguments;
+        Data input;
         if (mWorkSpec.isPeriodic()) {
-            arguments = mWorkSpec.arguments;
+            input = mWorkSpec.input;
         } else {
             InputMerger inputMerger = InputMerger.fromClassName(mWorkSpec.inputMergerClassName);
             if (inputMerger == null) {
@@ -105,16 +105,16 @@
                 setFailedAndNotify();
                 return;
             }
-            List<Arguments> inputs = new ArrayList<>();
-            inputs.add(mWorkSpec.arguments);
+            List<Data> inputs = new ArrayList<>();
+            inputs.add(mWorkSpec.input);
             inputs.addAll(mWorkSpecDao.getInputsFromPrerequisites(mWorkSpecId));
-            arguments = inputMerger.merge(inputs);
+            input = inputMerger.merge(inputs);
         }
 
         // Not always creating a worker here, as the WorkerWrapper.Builder can set a worker override
         // in test mode.
         if (mWorker == null) {
-            mWorker = workerFromWorkSpec(mAppContext, mWorkSpec, arguments, mRuntimeExtras);
+            mWorker = workerFromWorkSpec(mAppContext, mWorkSpec, input, mRuntimeExtras);
         }
 
         if (mWorker == null) {
@@ -218,10 +218,10 @@
             // Try to set the output for the failed work but check if the worker exists; this could
             // be a permanent error where we couldn't find or create the worker class.
             if (mWorker != null) {
-                // Update Arguments as necessary.
-                Arguments outputArgs = mWorker.getOutput();
-                if (outputArgs != null) {
-                    mWorkSpecDao.setOutput(mWorkSpecId, outputArgs);
+                // Update Data as necessary.
+                Data output = mWorker.getOutputData();
+                if (output != null) {
+                    mWorkSpecDao.setOutput(mWorkSpecId, output);
                 }
             }
 
@@ -279,10 +279,10 @@
         try {
             mWorkSpecDao.setState(SUCCEEDED, mWorkSpecId);
 
-            // Update Arguments as necessary.
-            Arguments outputArgs = mWorker.getOutput();
-            if (outputArgs != null) {
-                mWorkSpecDao.setOutput(mWorkSpecId, outputArgs);
+            // Update Data as necessary.
+            Data output = mWorker.getOutputData();
+            if (output != null) {
+                mWorkSpecDao.setOutput(mWorkSpecId, output);
             }
 
             // Unblock Dependencies and set Period Start Time
@@ -308,7 +308,7 @@
 
     static Worker workerFromWorkSpec(@NonNull Context context,
             @NonNull WorkSpec workSpec,
-            @NonNull Arguments arguments,
+            @NonNull Data inputData,
             @Nullable RuntimeExtras runtimeExtras) {
         String workerClassName = workSpec.workerClassName;
         String workSpecId = workSpec.id;
@@ -316,7 +316,7 @@
                 context,
                 workerClassName,
                 workSpecId,
-                arguments,
+                inputData,
                 runtimeExtras);
     }
 
@@ -326,7 +326,7 @@
      * @param context         The application {@link Context}
      * @param workerClassName The fully qualified class name for the {@link Worker}
      * @param workSpecId      The {@link WorkSpec} identifier
-     * @param arguments       The {@link Arguments} for the worker
+     * @param inputData       The {@link Data} for the worker
      * @return The instance of {@link Worker}
      *
      * @hide
@@ -337,7 +337,7 @@
             @NonNull Context context,
             @NonNull String workerClassName,
             @NonNull String workSpecId,
-            @NonNull Arguments arguments,
+            @NonNull Data inputData,
             @Nullable RuntimeExtras runtimeExtras) {
         Context appContext = context.getApplicationContext();
         try {
@@ -347,14 +347,14 @@
                     "internalInit",
                     Context.class,
                     String.class,
-                    Arguments.class,
+                    Data.class,
                     RuntimeExtras.class);
             internalInitMethod.setAccessible(true);
             internalInitMethod.invoke(
                     worker,
                     appContext,
                     workSpecId,
-                    arguments,
+                    inputData,
                     runtimeExtras);
             return worker;
         } catch (Exception e) {
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpec.java b/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpec.java
index 216340e..d4dd43e 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpec.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpec.java
@@ -32,10 +32,10 @@
 import android.support.annotation.NonNull;
 import android.support.annotation.RestrictTo;
 
-import androidx.work.Arguments;
 import androidx.work.BackoffPolicy;
 import androidx.work.BaseWork;
 import androidx.work.Constraints;
+import androidx.work.Data;
 import androidx.work.State;
 import androidx.work.WorkStatus;
 import androidx.work.impl.logger.Logger;
@@ -72,13 +72,13 @@
     @ColumnInfo(name = "input_merger_class_name")
     public String inputMergerClassName;
 
-    @ColumnInfo(name = "arguments")
+    @ColumnInfo(name = "input")
     @NonNull
-    public Arguments arguments = Arguments.EMPTY;
+    public Data input = Data.EMPTY;
 
     @ColumnInfo(name = "output")
     @NonNull
-    public Arguments output = Arguments.EMPTY;
+    public Data output = Data.EMPTY;
 
     @ColumnInfo(name = "initial_delay")
     public long initialDelay;
@@ -253,7 +253,7 @@
                 : workSpec.inputMergerClassName != null) {
             return false;
         }
-        if (!arguments.equals(workSpec.arguments)) return false;
+        if (!input.equals(workSpec.input)) return false;
         if (!output.equals(workSpec.output)) return false;
         if (!constraints.equals(workSpec.constraints)) return false;
         return backoffPolicy == workSpec.backoffPolicy;
@@ -265,7 +265,7 @@
         result = 31 * result + state.hashCode();
         result = 31 * result + workerClassName.hashCode();
         result = 31 * result + (inputMergerClassName != null ? inputMergerClassName.hashCode() : 0);
-        result = 31 * result + arguments.hashCode();
+        result = 31 * result + input.hashCode();
         result = 31 * result + output.hashCode();
         result = 31 * result + (int) (initialDelay ^ (initialDelay >>> 32));
         result = 31 * result + (int) (intervalDuration ^ (intervalDuration >>> 32));
@@ -327,7 +327,7 @@
         public State state;
 
         @ColumnInfo(name = "output")
-        public Arguments output;
+        public Data output;
 
         @Relation(
                 parentColumn = "id",
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpecDao.java b/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpecDao.java
index b0830eb..1e6805c 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpecDao.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpecDao.java
@@ -27,7 +27,7 @@
 import android.arch.persistence.room.Transaction;
 import android.support.annotation.NonNull;
 
-import androidx.work.Arguments;
+import androidx.work.Data;
 import androidx.work.State;
 import androidx.work.impl.Scheduler;
 
@@ -101,10 +101,10 @@
      * Updates the output of a {@link WorkSpec}.
      *
      * @param id The {@link WorkSpec} identifier to update
-     * @param output The {@link Arguments} to set as the output
+     * @param output The {@link Data} to set as the output
      */
     @Query("UPDATE workspec SET output=:output WHERE id=:id")
-    void setOutput(String id, Arguments output);
+    void setOutput(String id, Data output);
 
     /**
      * Updates the period start time of a {@link WorkSpec}.
@@ -211,14 +211,14 @@
 
     /**
      * Gets all inputs coming from prerequisites for a particular {@link WorkSpec}.  These are
-     * {@link Arguments} set via {@code Worker#setOutput()}.
+     * {@link Data} set via {@code Worker#setOutputData()}.
      *
      * @param id The {@link WorkSpec} identifier
      * @return A list of all inputs coming from prerequisites for {@code id}
      */
     @Query("SELECT output FROM workspec WHERE id IN "
             + "(SELECT prerequisite_id FROM dependency WHERE work_spec_id=:id)")
-    List<Arguments> getInputsFromPrerequisites(String id);
+    List<Data> getInputsFromPrerequisites(String id);
 
     /**
      * Retrieves work ids for unfinished work with a given tag.
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/EnqueueRunnable.java b/work/workmanager/src/main/java/androidx/work/impl/utils/EnqueueRunnable.java
index 0dc65c5..940e666 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/utils/EnqueueRunnable.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/utils/EnqueueRunnable.java
@@ -32,9 +32,9 @@
 import android.support.annotation.VisibleForTesting;
 import android.text.TextUtils;
 
-import androidx.work.Arguments;
 import androidx.work.BaseWork;
 import androidx.work.Constraints;
+import androidx.work.Data;
 import androidx.work.ExistingWorkPolicy;
 import androidx.work.State;
 import androidx.work.impl.Schedulers;
@@ -284,12 +284,12 @@
         Constraints constraints = workSpec.constraints;
         if (constraints.requiresBatteryNotLow() || constraints.requiresStorageNotLow()) {
             String workerClassName = workSpec.workerClassName;
-            Arguments.Builder builder = new Arguments.Builder();
+            Data.Builder builder = new Data.Builder();
             // Copy all arguments
-            builder.putAll(workSpec.arguments)
+            builder.putAll(workSpec.input)
                     .putString(ARGUMENT_CLASS_NAME, workerClassName);
             workSpec.workerClassName = ConstraintTrackingWorker.class.getName();
-            workSpec.arguments = builder.build();
+            workSpec.input = builder.build();
         }
     }
 }
diff --git a/work/workmanager/src/main/java/androidx/work/impl/workers/ConstraintTrackingWorker.java b/work/workmanager/src/main/java/androidx/work/impl/workers/ConstraintTrackingWorker.java
index 5d31d21..87b4cd7 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/workers/ConstraintTrackingWorker.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/workers/ConstraintTrackingWorker.java
@@ -64,18 +64,18 @@
 
     @Override
     public WorkerResult doWork() {
-        String className = getArguments().getString(ARGUMENT_CLASS_NAME, null);
+        String className = getInputData().getString(ARGUMENT_CLASS_NAME, null);
         if (TextUtils.isEmpty(className)) {
             Logger.debug(TAG, "No worker to delegate to.");
             return WorkerResult.FAILURE;
         }
-        // Instantiate the delegated worker. Use the same workSpecId, and the same Arguments
-        // as this Worker's Arguments are a superset of the delegate's Worker's Arguments.
+        // Instantiate the delegated worker. Use the same workSpecId, and the same Data
+        // as this Worker's Data are a superset of the delegate's Worker's Data.
         mDelegate = WorkerWrapper.workerFromClassName(
                 getAppContext(),
                 className,
                 getId(),
-                getArguments(),
+                getInputData(),
                 getRuntimeExtras());
 
         if (mDelegate == null) {
@@ -105,7 +105,7 @@
                     if (mAreConstraintsUnmet) {
                         return WorkerResult.RETRY;
                     } else {
-                        setOutput(mDelegate.getOutput());
+                        setOutputData(mDelegate.getOutputData());
                         return result;
                     }
                 }
diff --git a/work/workmanager/src/main/java/androidx/work/impl/workers/JoinWorker.java b/work/workmanager/src/main/java/androidx/work/impl/workers/JoinWorker.java
index ad04256..45d6262 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/workers/JoinWorker.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/workers/JoinWorker.java
@@ -30,7 +30,7 @@
 public class JoinWorker extends Worker {
     @Override
     public WorkerResult doWork() {
-        setOutput(getArguments());
+        setOutputData(getInputData());
         return WorkerResult.SUCCESS;
     }
 }
diff --git a/work/workmanager/src/test/java/androidx/work/ArrayCreatingInputMergerTest.java b/work/workmanager/src/test/java/androidx/work/ArrayCreatingInputMergerTest.java
index 127f85f..a5f464a 100644
--- a/work/workmanager/src/test/java/androidx/work/ArrayCreatingInputMergerTest.java
+++ b/work/workmanager/src/test/java/androidx/work/ArrayCreatingInputMergerTest.java
@@ -37,21 +37,21 @@
     private static final Long VALUE_LONG = Long.MAX_VALUE;
 
     ArrayCreatingInputMerger mArrayCreatingInputMerger;
-    Arguments mArgumentsWithIntArray;
-    Arguments mArgumentsWithInt;
-    Arguments mArgumentsWithLong;
+    Data mDataWithIntArray;
+    Data mDataWithInt;
+    Data mDataWithLong;
 
     @Before
     public void setUp() {
         mArrayCreatingInputMerger = new ArrayCreatingInputMerger();
-        mArgumentsWithIntArray = new Arguments.Builder().putIntArray(KEY, VALUE_INT_ARRAY).build();
-        mArgumentsWithInt = new Arguments.Builder().putInt(KEY, VALUE_INT).build();
-        mArgumentsWithLong = new Arguments.Builder().putLong(KEY, VALUE_LONG).build();
+        mDataWithIntArray = new Data.Builder().putIntArray(KEY, VALUE_INT_ARRAY).build();
+        mDataWithInt = new Data.Builder().putInt(KEY, VALUE_INT).build();
+        mDataWithLong = new Data.Builder().putLong(KEY, VALUE_LONG).build();
     }
 
     @Test
     public void testMerge_singleArgument() {
-        Arguments output = getOutputFor(mArgumentsWithInt);
+        Data output = getOutputFor(mDataWithInt);
         assertThat(output.size(), is(1));
         int[] outputArray = output.getIntArray(KEY);
         assertThat(outputArray.length, is(1));
@@ -60,7 +60,7 @@
 
     @Test
     public void testMerge_concatenatesNonArrays() {
-        Arguments output = getOutputFor(mArgumentsWithInt, mArgumentsWithInt);
+        Data output = getOutputFor(mDataWithInt, mDataWithInt);
         assertThat(output.size(), is(1));
         int[] outputArray = output.getIntArray(KEY);
         assertThat(outputArray.length, is(2));
@@ -70,7 +70,7 @@
 
     @Test
     public void testMerge_concatenatesArrays() {
-        Arguments output = getOutputFor(mArgumentsWithIntArray, mArgumentsWithIntArray);
+        Data output = getOutputFor(mDataWithIntArray, mDataWithIntArray);
         assertThat(output.size(), is(1));
         int[] outputArray = output.getIntArray(KEY);
         assertThat(outputArray.length, is(VALUE_INT_ARRAY.length * 2));
@@ -83,7 +83,7 @@
 
     @Test
     public void testMerge_concatenatesArrayAndPrimitive() {
-        Arguments output = getOutputFor(mArgumentsWithIntArray, mArgumentsWithInt);
+        Data output = getOutputFor(mDataWithIntArray, mDataWithInt);
         assertThat(output.size(), is(1));
         int[] outputArray = output.getIntArray(KEY);
         assertThat(outputArray.length, is(VALUE_INT_ARRAY.length + 1));
@@ -97,14 +97,14 @@
     public void testMerge_throwsIllegalStateExceptionOnDifferentTypes() {
         Throwable throwable = null;
         try {
-            Arguments output = getOutputFor(mArgumentsWithInt, mArgumentsWithLong);
+            Data output = getOutputFor(mDataWithInt, mDataWithLong);
         } catch (Throwable t) {
             throwable = t;
         }
         assertThat(throwable, instanceOf(IllegalStateException.class));
     }
 
-    private Arguments getOutputFor(Arguments... arguments) {
-        return mArrayCreatingInputMerger.merge(Arrays.asList(arguments));
+    private Data getOutputFor(Data... inputs) {
+        return mArrayCreatingInputMerger.merge(Arrays.asList(inputs));
     }
 }
diff --git a/work/workmanager/src/test/java/androidx/work/ArgumentsTest.java b/work/workmanager/src/test/java/androidx/work/DataTest.java
similarity index 64%
rename from work/workmanager/src/test/java/androidx/work/ArgumentsTest.java
rename to work/workmanager/src/test/java/androidx/work/DataTest.java
index 19f12c9..fa14c75 100644
--- a/work/workmanager/src/test/java/androidx/work/ArgumentsTest.java
+++ b/work/workmanager/src/test/java/androidx/work/DataTest.java
@@ -28,62 +28,62 @@
 import java.io.IOException;
 
 @SmallTest
-public class ArgumentsTest {
+public class DataTest {
     private static final String KEY1 = "key1";
     private static final String KEY2 = "key2";
 
     @Test
     public void testSize_noArguments() {
-        Arguments args = new Arguments.Builder().build();
-        assertThat(args.size(), is(0));
+        Data data = new Data.Builder().build();
+        assertThat(data.size(), is(0));
     }
 
     @Test
     public void testSize_hasArguments() {
-        Arguments args = new Arguments.Builder().putBoolean(KEY1, true).build();
-        assertThat(args.size(), is(1));
+        Data data = new Data.Builder().putBoolean(KEY1, true).build();
+        assertThat(data.size(), is(1));
     }
 
     @Test
     public void testSerializeEmpty() throws IOException, ClassNotFoundException {
-        Arguments args = Arguments.EMPTY;
+        Data data = Data.EMPTY;
 
-        byte[] byteArray = Arguments.toByteArray(args);
-        Arguments restoredArgs = Arguments.fromByteArray(byteArray);
+        byte[] byteArray = Data.toByteArray(data);
+        Data restoredData = Data.fromByteArray(byteArray);
 
-        assertThat(restoredArgs, is(args));
+        assertThat(restoredData, is(data));
     }
 
     @Test
     public void testSerializeString() throws IOException, ClassNotFoundException {
         String expectedValue1 = "value1";
         String expectedValue2 = "value2";
-        Arguments args = new Arguments.Builder()
+        Data data = new Data.Builder()
                 .putString(KEY1, expectedValue1)
                 .putString(KEY2, expectedValue2)
                 .build();
 
-        byte[] byteArray = Arguments.toByteArray(args);
-        Arguments restoredArgs = Arguments.fromByteArray(byteArray);
+        byte[] byteArray = Data.toByteArray(data);
+        Data restoredData = Data.fromByteArray(byteArray);
 
-        assertThat(restoredArgs, is(args));
+        assertThat(restoredData, is(data));
     }
 
     @Test
     public void testSerializeIntArray() throws IOException, ClassNotFoundException {
         int[] expectedValue1 = new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
         int[] expectedValue2 = new int[]{10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
-        Arguments args = new Arguments.Builder()
+        Data data = new Data.Builder()
                 .putIntArray(KEY1, expectedValue1)
                 .putIntArray(KEY2, expectedValue2)
                 .build();
 
-        byte[] byteArray = Arguments.toByteArray(args);
-        Arguments restoredArgs = Arguments.fromByteArray(byteArray);
+        byte[] byteArray = Data.toByteArray(data);
+        Data restoredData = Data.fromByteArray(byteArray);
 
-        assertThat(restoredArgs, is(notNullValue()));
-        assertThat(restoredArgs.size(), is(2));
-        assertThat(restoredArgs.getIntArray(KEY1), is(equalTo(expectedValue1)));
-        assertThat(restoredArgs.getIntArray(KEY2), is(equalTo(expectedValue2)));
+        assertThat(restoredData, is(notNullValue()));
+        assertThat(restoredData.size(), is(2));
+        assertThat(restoredData.getIntArray(KEY1), is(equalTo(expectedValue1)));
+        assertThat(restoredData.getIntArray(KEY2), is(equalTo(expectedValue2)));
     }
 }
diff --git a/work/workmanager/src/test/java/androidx/work/OverwritingInputMergerTest.java b/work/workmanager/src/test/java/androidx/work/OverwritingInputMergerTest.java
index 397c849..a6fcd31 100644
--- a/work/workmanager/src/test/java/androidx/work/OverwritingInputMergerTest.java
+++ b/work/workmanager/src/test/java/androidx/work/OverwritingInputMergerTest.java
@@ -41,8 +41,8 @@
         String key = "key";
         String value = "value";
 
-        Arguments arguments = new Arguments.Builder().putString(key, value).build();
-        Arguments output = getOutputFor(arguments);
+        Data input = new Data.Builder().putString(key, value).build();
+        Data output = getOutputFor(input);
 
         assertThat(output.size(), is(1));
         assertThat(output.getString(key, null), is(value));
@@ -58,16 +58,16 @@
         String key3 = "key3";
         String value3 = "value3";
 
-        Arguments arguments1 = new Arguments.Builder()
+        Data input1 = new Data.Builder()
                 .putString(key1, value1)
                 .putString(key2, value2)
                 .build();
-        Arguments arguments2 = new Arguments.Builder()
+        Data input2 = new Data.Builder()
                 .putString(key1, value1a)
                 .putString(key3, value3)
                 .build();
 
-        Arguments output = getOutputFor(arguments1, arguments2);
+        Data output = getOutputFor(input1, input2);
 
         assertThat(output.size(), is(3));
         assertThat(output.getString(key1, null), is(value1a));
@@ -75,7 +75,7 @@
         assertThat(output.getString(key3, null), is(value3));
     }
 
-    private Arguments getOutputFor(Arguments... arguments) {
-        return mOverwritingInputMerger.merge(Arrays.asList(arguments));
+    private Data getOutputFor(Data... inputs) {
+        return mOverwritingInputMerger.merge(Arrays.asList(inputs));
     }
 }
