You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Set to `true` to run the actor asynchronously",
17
33
reloadProps: true,
18
34
},
35
+
timeout: {
36
+
type: "string",
37
+
label: "Timeout",
38
+
description: "Optional timeout for the run, in seconds. By default, the run uses a timeout specified in the default run configuration for the Actor.",
39
+
optional: true,
40
+
},
41
+
memory: {
42
+
type: "string",
43
+
label: "Memory",
44
+
description: "Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses a memory limit specified in the default run configuration for the Actor.",
45
+
optional: true,
46
+
},
47
+
maxItems: {
48
+
type: "string",
49
+
label: "Max Items",
50
+
description: "The maximum number of items that the Actor run should return. This is useful for pay-per-result Actors, as it allows you to limit the number of results that will be charged to your subscription. You can access the maximum number of items in your Actor by using the ACTOR_MAX_PAID_DATASET_ITEMS environment variable.",
51
+
optional: true,
52
+
},
53
+
maxTotalChargeUsd: {
54
+
type: "string",
55
+
label: "Max Total Charge USD",
56
+
description: "Specifies the maximum cost of the Actor run. This parameter is useful for pay-per-event Actors, as it allows you to limit the amount charged to your subscription. You can access the maximum cost in your Actor by using the ACTOR_MAX_TOTAL_CHARGE_USD environment variable.",
57
+
optional: true,
58
+
},
59
+
webhooks: {
60
+
type: "string",
61
+
label: "Webhooks",
62
+
description: "Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array of objects defining the webhooks. For more information, see [Webhooks documentation](https://docs.apify.com/platform/integrations/webhooks).",
if(props[key].type!=="object"){// default values don't work properly for object props
155
+
props[key].default=value.default;
156
+
}
111
157
}
112
158
}
159
+
}catch{
160
+
props.properties={
161
+
type: "object",
162
+
label: "Properties",
163
+
description: "Properties to set for this actor",
164
+
};
165
+
}
166
+
if(this.runAsynchronously){
167
+
props.outputRecordKey={
168
+
type: "string",
169
+
label: "Output Record Key",
170
+
description: "Key of the record from run's default key-value store to be returned in the response. By default, it is OUTPUT.",
171
+
optional: true,
172
+
};
173
+
}else{
174
+
props.waitForFinish={
175
+
type: "string",
176
+
label: "Wait For Finish",
177
+
description: "The maximum number of seconds the server waits for the run to finish. By default, it is 0, the maximum value is 60. If the build finishes in time then the returned run object will have a terminal status (e.g. SUCCEEDED), otherwise it will have a transitional status (e.g. RUNNING).",
178
+
optional: true,
179
+
};
113
180
}
114
181
}
115
182
returnprops;
@@ -123,12 +190,37 @@ export default {
123
190
prepareData,
124
191
apify,
125
192
actorId,
193
+
buildId,
194
+
properties,
195
+
runAsynchronously,
196
+
outputRecordKey,
197
+
timeout,
198
+
memory,
199
+
maxItems,
200
+
maxTotalChargeUsd,
201
+
waitForFinish,
202
+
webhooks,
126
203
...data
127
204
}=this;
128
205
129
-
constresponse=awaitapify.runActor({
206
+
constfn=runAsynchronously
207
+
? apify.runActorAsynchronously
208
+
: apify.runActor;
209
+
210
+
constresponse=awaitfn({
130
211
actorId,
131
-
data: awaitprepareData(data),
212
+
data: properties
213
+
? parseObject(properties)
214
+
: awaitprepareData(data),
215
+
params: {
216
+
outputRecordKey,
217
+
timeout,
218
+
memory,
219
+
maxItems,
220
+
maxTotalChargeUsd,
221
+
waitForFinish,
222
+
webhooks,
223
+
},
132
224
});
133
225
$.export("$summary",`Successfully started actor run with ID: ${response.data.id}`);
0 commit comments